diff --git a/ts/routes/image-occlusion/tools/tool-undo-redo.ts b/ts/routes/image-occlusion/tools/tool-undo-redo.ts index 187a8b33d..0785d3908 100644 --- a/ts/routes/image-occlusion/tools/tool-undo-redo.ts +++ b/ts/routes/image-occlusion/tools/tool-undo-redo.ts @@ -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;