Skip to content

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

web: hide note title immediately on setting change

Abdullah Attaf78cfe59e83f
diff --git a/apps/web/src/stores/setting-store.js b/apps/web/src/stores/setting-store.js
index 0fef9ea9f..75912f6c9 100644
--- a/apps/web/src/stores/setting-store.js
+++ b/apps/web/src/stores/setting-store.js
@@ -23,7 +23,9 @@ import { desktop } from "../common/desktop-bridge";
import createStore from "../common/store";
import Config from "../utils/config";
import BaseStore from "./index";
+import { store as editorStore } from "./editor-store";
import { isTelemetryEnabled, setTelemetry } from "../utils/telemetry";
+import { setDocumentTitle } from "../utils/dom";
/**
* @extends {BaseStore<SettingStore>}
@@ -165,9 +167,12 @@ class SettingStore extends BaseStore {
};
toggleHideTitle = async () => {
- const hideTitle = this.get().hideNoteTitle;
- this.set({ hideNoteTitle: !hideTitle });
- Config.set("hideNoteTitle", !hideTitle);
+ const { hideNoteTitle } = this.get();
+ this.set({ hideNoteTitle: !hideNoteTitle });
+ Config.set("hideNoteTitle", !hideNoteTitle);
+ setDocumentTitle(
+ !hideNoteTitle ? undefined : editorStore.get().session.title
+ );
};
toggleAutoUpdates = async () => {