diff --git a/src/renderer/src/pages/home/Tabs/index.tsx b/src/renderer/src/pages/home/Tabs/index.tsx index c2cfc57385..33293f0ce1 100644 --- a/src/renderer/src/pages/home/Tabs/index.tsx +++ b/src/renderer/src/pages/home/Tabs/index.tsx @@ -47,6 +47,7 @@ const HomeTabs: FC = ({ const { chat } = useRuntime() const { activeTopicOrSession } = chat const isSessionView = activeTopicOrSession === 'session' + const isTopicView = activeTopicOrSession === 'topic' const [tab, setTab] = useState(position === 'left' ? _tab || 'assistants' : 'topic') const borderStyle = '0.5px solid var(--color-border)' @@ -60,7 +61,7 @@ const HomeTabs: FC = ({ } const showTab = position === 'left' && topicPosition === 'left' - const canShowSettingsTab = !isSessionView + const shouldShowSettingsTab = !isSessionView const onCreateAssistant = async () => { const assistant = await AddAssistantPopup.show() @@ -113,9 +114,9 @@ const HomeTabs: FC = ({ {t('assistants.abbr')} setTab('topic')}> - {activeTopicOrSession === 'topic' ? t('common.topics') : t('agent.session.label_other')} + {isTopicView ? t('common.topics') : t('agent.session.label_other')} - {canShowSettingsTab && ( + {shouldShowSettingsTab && ( setTab('settings')}> {t('settings.title')} @@ -126,9 +127,9 @@ const HomeTabs: FC = ({ {position === 'right' && topicPosition === 'right' && ( setTab('topic')}> - {activeTopicOrSession === 'topic' ? t('common.topics') : t('agent.session.label_other')} + {isTopicView ? t('common.topics') : t('agent.session.label_other')} - {canShowSettingsTab && ( + {shouldShowSettingsTab && ( setTab('settings')}> {t('settings.title')} @@ -153,7 +154,7 @@ const HomeTabs: FC = ({ position={position} /> )} - {tab === 'settings' && canShowSettingsTab && } + {tab === 'settings' && shouldShowSettingsTab && } )