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
This commit is contained in:
@@ -104,6 +104,12 @@ const HomeTabs: FC<Props> = ({
|
||||
}
|
||||
}, [position, tab, topicPosition, forceToSeeAllTab])
|
||||
|
||||
useEffect(() => {
|
||||
if (activeTopicOrSession === 'session' && tab === 'settings') {
|
||||
setTab('topic')
|
||||
}
|
||||
}, [activeTopicOrSession, tab])
|
||||
|
||||
return (
|
||||
<Container
|
||||
style={{ ...border, ...style }}
|
||||
|
||||
Reference in New Issue
Block a user