Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

core: notify autosync before setting remote= false

Abdullah Atta051b7fcb8caa
diff --git a/packages/core/src/api/settings.js b/packages/core/src/api/settings.js
index ca419e72f..3188c32e4 100644
--- a/packages/core/src/api/settings.js
+++ b/packages/core/src/api/settings.js
@@ -209,6 +209,12 @@ class Settings {
}
async _saveSettings(updateDateModified = true) {
+ this._db.eventManager.publish(
+ EVENTS.databaseUpdated,
+ "settings",
+ this._settings
+ );
+
if (updateDateModified) {
this._settings.dateModified = Date.now();
this._settings.synced = false;
@@ -216,11 +222,6 @@ class Settings {
delete this._settings.remote;
await this._db.storage.write("settings", this._settings);
- this._db.eventManager.publish(
- EVENTS.databaseUpdated,
- "settings",
- this._settings
- );
}
}
export default Settings;