Improve SettingsUserStore handling

This commit is contained in:
djmaze 2021-03-18 16:12:24 +01:00
parent ce74b2e92f
commit 97d5f8762d
8 changed files with 49 additions and 96 deletions

View file

@ -22,6 +22,8 @@ export class OpenPgpUserSettings {
this.openPgpKeyForDeletion = ko.observable(null).deleteAccessHelper();
this.allowDraftAutosave = SettingsUserStore.allowDraftAutosave;
this.allowDraftAutosave.subscribe(value => Remote.saveSetting('AllowDraftAutosave', value ? 1 : 0))
}
addOpenPgpKey() {
@ -61,10 +63,4 @@ export class OpenPgpUserSettings {
}
}
}
onBuild() {
setTimeout(() => {
this.allowDraftAutosave.subscribe(Remote.saveSettingsHelper('AllowDraftAutosave', v=>v?'1':'0'));
}, 50);
}
}