Skip to content

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

fix: ensure that settings object is reset on logout

thecodrr5fb68bb08e14
diff --git a/packages/core/api/settings.js b/packages/core/api/settings.js
index c34a37548..eae60e1cd 100644
--- a/packages/core/api/settings.js
+++ b/packages/core/api/settings.js
@@ -18,8 +18,9 @@ class Settings {
this._initSettings(settings);
await this._saveSettings(false);
- EV.subscribe(EVENTS.userLoggedOut, () => {
+ EV.subscribe(EVENTS.userLoggedOut, async () => {
this._initSettings();
+ await this._saveSettings(false);
});
}
@@ -29,6 +30,7 @@ class Settings {
async merge(item) {
if (this._settings.dateModified > (await this._db.lastSynced())) {
+ this._settings = item.id;
this._settings.pins = setManipulator.union(
this._settings.pins,
item.pins,