File tree 1 file changed +7
-4
lines changed
frontend/src/components/system
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -60,12 +60,15 @@ const Sidebar: React.FC<{
60
60
const apps = useApps ( )
61
61
const { models } = useContext ( AccountContext )
62
62
const activeTab = useMemo ( ( ) => {
63
- // If app_id is present in the URL, default to the apps tab (index 1)
63
+ // Always respect resource_type if it's present
64
+ const activeIndex = RESOURCE_TYPES . findIndex ( ( type ) => type == router . params . resource_type )
65
+ if ( activeIndex >= 0 ) return activeIndex
66
+ // If no resource_type specified but app_id is present, default to apps tab
64
67
if ( router . params . app_id ) {
65
- return RESOURCE_TYPES . findIndex ( type => type === 'apps' ) ;
68
+ return RESOURCE_TYPES . findIndex ( type => type === 'apps' )
66
69
}
67
- const activeIndex = RESOURCE_TYPES . findIndex ( ( type ) => type == router . params . resource_type )
68
- return activeIndex >= 0 ? activeIndex : 0
70
+ // Default to first tab (chats )
71
+ return 0
69
72
} , [
70
73
router . params ,
71
74
] )
You can’t perform that action at this time.
0 commit comments