From 5f98ed3d5363f73ec0ba7a10a711714edb38ae04 Mon Sep 17 00:00:00 2001 From: Gamosoft Date: Tue, 21 Apr 2026 16:04:39 +0200 Subject: [PATCH] don't clear undo stack on drawing save --- frontend/app.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/frontend/app.js b/frontend/app.js index d818efb..e39f847 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -3218,14 +3218,16 @@ function noteApp() { throw new Error(detail || res.statusText); } await this.loadNotes(); - if (this._drawingObjectURL) { - URL.revokeObjectURL(this._drawingObjectURL); - this._drawingObjectURL = null; - } - this.drawingOps = []; - this.drawingRedoStack = []; - await this.initDrawingViewer(); + // Manual save: flatten to PNG on disk and reset canvas state from file (clears stroke undo/redo). + // Autosave: only persist the PNG; keep drawingOps / redo stacks like note undo after save. if (!silent) { + if (this._drawingObjectURL) { + URL.revokeObjectURL(this._drawingObjectURL); + this._drawingObjectURL = null; + } + this.drawingOps = []; + this.drawingRedoStack = []; + await this.initDrawingViewer(); this.toast(this.t('drawing.saved'), { type: 'success' }); } else { this.lastSaved = true;