feat(save_indicator): report saving and saved states

This commit is contained in:
Elian Doran 2026-01-02 22:53:18 +02:00
parent e8d1fa7447
commit 62af66b5ae
No known key found for this signature in database

View File

@ -33,7 +33,9 @@ export default class SpacedUpdate {
this.changed = false; // optimistic...
try {
this.stateCallback?.("saving");
await this.updater();
this.stateCallback?.("saved");
} catch (e) {
this.changed = true;
@ -72,7 +74,9 @@ export default class SpacedUpdate {
}
if (Date.now() - this.lastUpdated > this.updateInterval) {
this.stateCallback?.("saving");
this.updater();
this.stateCallback?.("saved");
this.lastUpdated = Date.now();
this.changed = false;
} else {