fix undo delete relationships

This commit is contained in:
Guy Ben-Aharon
2024-08-20 22:23:55 +03:00
parent fb7763855e
commit 9f21eed1fc
4 changed files with 7 additions and 1 deletions

View File

@@ -699,7 +699,7 @@ export const ChartDBProvider: React.FC<React.PropsWithChildren> = ({
ids.map((id) => db.deleteRelationship({ diagramId, id }))
);
if (options.updateHistory) {
if (prevRelationships.length > 0 && options.updateHistory) {
addUndoAction({
action: 'removeRelationships',
redoData: { relationshipsIds: ids },