don't clear undo stack on drawing save
This commit is contained in:
parent
ef82c277c0
commit
5f98ed3d53
|
|
@ -3218,14 +3218,16 @@ function noteApp() {
|
||||||
throw new Error(detail || res.statusText);
|
throw new Error(detail || res.statusText);
|
||||||
}
|
}
|
||||||
await this.loadNotes();
|
await this.loadNotes();
|
||||||
if (this._drawingObjectURL) {
|
// Manual save: flatten to PNG on disk and reset canvas state from file (clears stroke undo/redo).
|
||||||
URL.revokeObjectURL(this._drawingObjectURL);
|
// Autosave: only persist the PNG; keep drawingOps / redo stacks like note undo after save.
|
||||||
this._drawingObjectURL = null;
|
|
||||||
}
|
|
||||||
this.drawingOps = [];
|
|
||||||
this.drawingRedoStack = [];
|
|
||||||
await this.initDrawingViewer();
|
|
||||||
if (!silent) {
|
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' });
|
this.toast(this.t('drawing.saved'), { type: 'success' });
|
||||||
} else {
|
} else {
|
||||||
this.lastSaved = true;
|
this.lastSaved = true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue