mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 08:15:52 +01:00
fixes
This commit is contained in:
@@ -7,8 +7,10 @@ export default class SpacedUpdate {
|
||||
}
|
||||
|
||||
scheduleUpdate() {
|
||||
this.changed = true;
|
||||
setTimeout(() => this.triggerUpdate())
|
||||
if (!this.changeForbidden) {
|
||||
this.changed = true;
|
||||
setTimeout(() => this.triggerUpdate());
|
||||
}
|
||||
}
|
||||
|
||||
async updateNowIfNecessary() {
|
||||
@@ -33,4 +35,15 @@ export default class SpacedUpdate {
|
||||
this.scheduleUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
allowUpdateWithoutChange(callback) {
|
||||
this.changeForbidden = true;
|
||||
|
||||
try {
|
||||
callback();
|
||||
}
|
||||
finally {
|
||||
this.changeForbidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user