From 187ae4a23928e4ff58ecdd4fb8457ef8fae79179 Mon Sep 17 00:00:00 2001 From: Jonathan Summers-Muir Date: Fri, 13 Dec 2024 22:21:40 +0800 Subject: [PATCH] logic error --- .../layouts/SQLEditorLayout/sql-editor-menu-static-links.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/studio/components/layouts/SQLEditorLayout/sql-editor-menu-static-links.tsx b/apps/studio/components/layouts/SQLEditorLayout/sql-editor-menu-static-links.tsx index 9a576682a0a..7991bc43b85 100644 --- a/apps/studio/components/layouts/SQLEditorLayout/sql-editor-menu-static-links.tsx +++ b/apps/studio/components/layouts/SQLEditorLayout/sql-editor-menu-static-links.tsx @@ -22,11 +22,12 @@ export function SqlEditorMenuStaticLinks() { return (
{OPTIONS.map((pageId) => { + const pageActive = isPageActive(pageId) const isPreview = isSqlEditorTabsEnabled ? tabs.previewTabId === `sql-${pageId}` : false - const isOpen = tabs.openTabs.includes(`sql-${pageId}`) - const isActive = !isSqlEditorTabsEnabled + const isOpen = !isSqlEditorTabsEnabled ? isPageActive(pageId) : Object.values(tabs.tabsMap).some((tab) => tab?.id === `sql-${pageId}`) + const isActive = tabs.openTabs.includes(`sql-${pageId}`) && pageActive return (