Skip to content

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

fix: clear settings on logout

thecodrrfa9c1ac2d25d
diff --git a/packages/core/api/settings.js b/packages/core/api/settings.js
index 6c9ee9ebe..b72db94e6 100644
--- a/packages/core/api/settings.js
+++ b/packages/core/api/settings.js
@@ -31,6 +31,15 @@ class Settings {
var settings = await this._db.context.read("settings");
if (!settings) await this._db.context.write("settings", this._settings);
else this._settings = settings;
+ EV.subscribe("user:loggedOut", () => {
+ this._settings = {
+ type: "settings",
+ id: id(),
+ pins: [],
+ dateEdited: 0,
+ dateCreated: Date.now(),
+ };
+ });
}
async pin(type, data) {