Skip to content

Commit

Permalink
Merge pull request #426 from jackgriffiths/history-max-steps-bug
Browse files Browse the repository at this point in the history
Fix undo not working after max steps exceeded
  • Loading branch information
newcat authored Oct 19, 2024
2 parents cf9470f + 7eb9cad commit 1760310
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/renderer-vue/src/history/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ export function useHistory(graph: Ref<Graph>, commandHandler: ICommandHandler):
}

steps.value.push(step);
currentIndex.value++;

while (steps.value.length > maxSteps.value) {
steps.value.shift();
}

currentIndex.value = steps.value.length - 1;
}
};

Expand Down

0 comments on commit 1760310

Please sign in to comment.