Skip to content

Commit b048848

Browse files
committed
Add conditional logic for tab selection in ResourceListBar
1 parent 003d92e commit b048848

File tree

1 file changed

+14
-0
lines changed
  • lazyweb/components/desktop/ResourceListBar

1 file changed

+14
-0
lines changed

lazyweb/components/desktop/ResourceListBar/index.tsx

+14
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,20 @@ const ResourceListBar = (props: Props) => {
7272
pathname: '/',
7373
}, undefined, { shallow: true })
7474
}
75+
76+
if(localStorage.getItem('token') && !router.query.tab){
77+
router.replace({
78+
pathname: '/',
79+
query: { tab: 'all' },
80+
}, undefined, { shallow: true })
81+
}
82+
83+
if(localStorage.getItem('token') && router.query.tab){
84+
const tab = tabs.find(e=>e.slug === router.query.tab)
85+
if(tab){
86+
selectionHandler(tab.id)
87+
}
88+
}
7589

7690

7791
if(session?.email){

0 commit comments

Comments
 (0)