fix(home-tabs): correct tab switching logic for left position (#10858)

Ensure proper tab switching when position is left and topicPosition is right by including 'settings' tab in the condition
This commit is contained in:
Phantom 2025-10-22 01:15:25 +08:00 committed by GitHub
parent f58d2e2e52
commit c021947d52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,7 +29,7 @@ interface Props {
style?: React.CSSProperties
}
let _tab: any = ''
let _tab: Tab | null = null
const HomeTabs: FC<Props> = ({
activeAssistant,
@ -103,7 +103,7 @@ const HomeTabs: FC<Props> = ({
if (position === 'right' && topicPosition === 'right' && tab === 'assistants') {
setTab('topic')
}
if (position === 'left' && topicPosition === 'right' && tab === 'topic') {
if (position === 'left' && topicPosition === 'right' && (tab === 'topic' || tab === 'settings')) {
setTab('assistants')
}
}, [position, tab, topicPosition, forceToSeeAllTab])