From a87c06aab847dc275165c00cfc227e5a2d7f5921 Mon Sep 17 00:00:00 2001 From: icarus Date: Thu, 25 Sep 2025 23:45:13 +0800 Subject: [PATCH] fix(home-tabs): prevent settings tab when active topic is session Add useEffect to automatically switch to topic tab when active topic is session and tab is settings to avoid invalid state --- src/renderer/src/pages/home/Tabs/index.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/renderer/src/pages/home/Tabs/index.tsx b/src/renderer/src/pages/home/Tabs/index.tsx index 7d5daec6e5..f1adf9e4f3 100644 --- a/src/renderer/src/pages/home/Tabs/index.tsx +++ b/src/renderer/src/pages/home/Tabs/index.tsx @@ -104,6 +104,12 @@ const HomeTabs: FC = ({ } }, [position, tab, topicPosition, forceToSeeAllTab]) + useEffect(() => { + if (activeTopicOrSession === 'session' && tab === 'settings') { + setTab('topic') + } + }, [activeTopicOrSession, tab]) + return (