Skip to content

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

web: handle case where a new note session is in the tab history

Abdullah Atta782a979397e0
diff --git a/apps/web/src/stores/editor-store.ts b/apps/web/src/stores/editor-store.ts
index 59b2b8b2b..0d0ec2212 100644
--- a/apps/web/src/stores/editor-store.ts
+++ b/apps/web/src/stores/editor-store.ts
@@ -810,7 +810,10 @@ class EditorStore extends BaseStore<EditorStore> {
return false;
}
- if ("note" in session) {
+ if (session.type === "new") {
+ this.activateSession(session.id);
+ return true;
+ } else {
if (!(await db.notes.exists(session.note.id))) {
tabSessionHistory.remove(tabId, session.id);
this.set((state) => {
@@ -827,7 +830,6 @@ class EditorStore extends BaseStore<EditorStore> {
this.activateSession(session.id);
return true;
}
- return false;
};
addSession = (session: EditorSession, silent = false) => {