Skip to content

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

web: reactivate same session if user tries to create consecutive new notes

Abdullah Attaa6c8bbbf0ac0
diff --git a/apps/web/src/stores/editor-store.ts b/apps/web/src/stores/editor-store.ts
index cd8daf419..137cd39b9 100644
--- a/apps/web/src/stores/editor-store.ts
+++ b/apps/web/src/stores/editor-store.ts
@@ -1000,14 +1000,14 @@ class EditorStore extends BaseStore<EditorStore> {
};
newSession = () => {
- const { activeTabId } = this.get();
+ const { activeTabId, activateSession } = this.get();
if (!activeTabId) {
this.addTab();
return;
}
const session = this.getActiveSession();
- if (session?.type === "new") return;
+ if (session?.type === "new") return activateSession(session.id);
const sessionId = tabSessionHistory.add(activeTabId);
this.addSession({