Skip to content

Build your personal knowledge base with Trilium Notes

feat(save_indicator): report saving and saved states

Elian Doran62af66b5aeec
diff --git a/apps/client/src/services/spaced_update.ts b/apps/client/src/services/spaced_update.ts
index 863c6844ac..1347d37572 100644
--- a/apps/client/src/services/spaced_update.ts
+++ b/apps/client/src/services/spaced_update.ts
@@ -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 {