From 2eaf07118a2d2f45b7959be80afa5dbe72182c4c Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Tue, 4 Feb 2025 14:59:11 +0500 Subject: [PATCH] web: open note history in new tab if active tab is pinned --- apps/web/src/stores/editor-store.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/web/src/stores/editor-store.ts b/apps/web/src/stores/editor-store.ts index 4f6c29fed..f2e253ef4 100644 --- a/apps/web/src/stores/editor-store.ts +++ b/apps/web/src/stores/editor-store.ts @@ -595,9 +595,18 @@ class EditorStore extends BaseStore { if (!oldContent || !currentContent) return; - const { getSession, addSession, sessions, activeTabId, tabs } = this.get(); + const { + getSession, + addSession, + sessions, + activeTabId, + getActiveTab, + tabs + } = this.get(); - const tabId = activeTabId ?? this.addTab(); + const tabId = getActiveTab()?.pinned + ? this.addTab(getId()) + : activeTabId || this.addTab(getId()); const tab = tabs.find((t) => t.id === tabId); const activeSession = tab && getSession(tab.sessionId); const oldSession = sessions.find(