diff --git a/apps/web/src/stores/editor-store.ts b/apps/web/src/stores/editor-store.ts index 8a83ceb5b..2d7e47255 100644 --- a/apps/web/src/stores/editor-store.ts +++ b/apps/web/src/stores/editor-store.ts @@ -138,7 +138,13 @@ class EditorStore extends BaseStore { const session = this.get().session; if (session.id) await db.fs().cancel(session.id); - if (session.id === noteId && !force) return; + if (session.id === noteId && !force) { + noteStore.get().setSelectedNote(noteId); + setDocumentTitle( + settingStore.get().hideNoteTitle ? undefined : session.title + ); + return; + } if (session.state === SESSION_STATES.unlocked) { this.set((state) => { @@ -152,7 +158,7 @@ class EditorStore extends BaseStore { (await db.notes.note(noteId)) || (await db.notes.trashed(noteId)); if (!note) return; - noteStore.setSelectedNote(note.id); + noteStore.get().setSelectedNote(note.id); setDocumentTitle(settingStore.get().hideNoteTitle ? undefined : note.title); if (await db.vaults.itemExists(note))