don't clear undo stack on drawing save

This commit is contained in:
Gamosoft 2026-04-21 16:04:39 +02:00
parent ef82c277c0
commit 5f98ed3d53
1 changed files with 9 additions and 7 deletions

View File

@ -3218,6 +3218,9 @@ function noteApp() {
throw new Error(detail || res.statusText);
}
await this.loadNotes();
// 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;
@ -3225,7 +3228,6 @@ function noteApp() {
this.drawingOps = [];
this.drawingRedoStack = [];
await this.initDrawingViewer();
if (!silent) {
this.toast(this.t('drawing.saved'), { type: 'success' });
} else {
this.lastSaved = true;