Skip to content

Commit 17c13e0

Browse files
committed
fix conflicting app vs chat url
1 parent 2e8bdae commit 17c13e0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

frontend/src/components/system/Sidebar.tsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,15 @@ const Sidebar: React.FC<{
6060
const apps = useApps()
6161
const { models } = useContext(AccountContext)
6262
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
6467
if (router.params.app_id) {
65-
return RESOURCE_TYPES.findIndex(type => type === 'apps');
68+
return RESOURCE_TYPES.findIndex(type => type === 'apps')
6669
}
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
6972
}, [
7073
router.params,
7174
])

0 commit comments

Comments
 (0)