(beforeIndex: number)
| 763 | // Helper functions for message actions (regenerate/edit) |
| 764 | // Extract previous XML snapshot before a given message index |
| 765 | const getPreviousXml = (beforeIndex: number): string => { |
| 766 | const snapshotKeys = Array.from(xmlSnapshotsRef.current.keys()) |
| 767 | .filter((k) => k < beforeIndex) |
| 768 | .sort((a, b) => b - a) |
| 769 | return snapshotKeys.length > 0 |
| 770 | ? xmlSnapshotsRef.current.get(snapshotKeys[0]) || "" |
| 771 | : "" |
| 772 | } |
| 773 | |
| 774 | // Restore diagram from snapshot and update ref |
| 775 | const restoreDiagramFromSnapshot = (savedXml: string) => { |
no outgoing calls
no test coverage detected