mirror of
https://github.com/zadam/trilium.git
synced 2026-01-10 16:44:29 +01:00
feat(save_indicator): report saving and saved states
This commit is contained in:
parent
e8d1fa7447
commit
62af66b5ae
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user