fix io undo logic error (#4027)

This commit is contained in:
llama 2025-05-22 21:11:04 +08:00 committed by GitHub
parent 6a1d55ae75
commit 420cd237df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -117,7 +117,7 @@ class UndoStack {
private push(): void {
const entry = JSON.stringify(this.canvas?.toJSON(["id"]));
if (entry === this.stack[this.stack.length - 1]) {
if (entry === this.stack[this.index]) {
return;
}
this.stack.length = this.index + 1;