refactor: update tab navigation logic in OrganizationSettings to ensure valid tab selection and improve user experience
This commit is contained in:
@@ -171,8 +171,9 @@ export default function OrganizationSettings() {
|
||||
|
||||
useEffect(() => {
|
||||
const tab = searchParams.get('tab')
|
||||
if ((tab === 'billing' || tab === 'members' || tab === 'audit') && tab !== activeTab) {
|
||||
setActiveTab(tab)
|
||||
const validTab = (tab === 'billing' || tab === 'members' || tab === 'audit') ? tab : 'general'
|
||||
if (validTab !== activeTab) {
|
||||
setActiveTab(validTab)
|
||||
}
|
||||
}, [searchParams, activeTab])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user