From be81b73d11d428e6c6ae900bf36f2d9880426094 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Fri, 3 Apr 2026 02:16:12 +0200 Subject: [PATCH] Clear transform session and emit changes in undo/redo methods --- src/app/editor-store.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/app/editor-store.ts b/src/app/editor-store.ts index a437b421..f8ef78d2 100644 --- a/src/app/editor-store.ts +++ b/src/app/editor-store.ts @@ -358,16 +358,23 @@ export class EditorStore { } undo(): boolean { + let clearedTransformSession = false; + if (this.viewportTransientState.transformSession.kind !== "none") { this.viewportTransientState = { ...this.viewportTransientState, transformSession: createInactiveTransformSession() }; + clearedTransformSession = true; } const command = this.history.undo(this.commandContext); if (command === null) { + if (clearedTransformSession) { + this.emit(); + } + return false; } @@ -377,16 +384,23 @@ export class EditorStore { } redo(): boolean { + let clearedTransformSession = false; + if (this.viewportTransientState.transformSession.kind !== "none") { this.viewportTransientState = { ...this.viewportTransientState, transformSession: createInactiveTransformSession() }; + clearedTransformSession = true; } const command = this.history.redo(this.commandContext); if (command === null) { + if (clearedTransformSession) { + this.emit(); + } + return false; }