Skip to content

Commit

Permalink
feat: Make URL /library-v1 when referencing legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuf-musleh committed Jun 6, 2024
1 parent 567dcb4 commit 094086e
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/studio-home/tabs-section/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@ const TabsSection = ({

// This is needed to handle navigating using the back/forward buttons in the browser
useEffect(() => {
// Handle special case when navigating directly to /libraries-v1 or /libraries in `v1 only` mode
// Handle special case when navigating directly to /libraries-v1
// we need to call dispatch to fetch library data
if (pathname.includes('/libraries-v1')
|| (isMixedOrV1LibrariesMode(libMode) && pathname.includes('/libraries'))
) {
if (pathname.includes('/libraries-v1')) {
dispatch(fetchLibraryData());
}
setTabKey(initTabKeyState(pathname));
Expand Down Expand Up @@ -175,11 +173,7 @@ const TabsSection = ({
navigate('/home');
} else if (tab === TABS_LIST.legacyLibraries) {
dispatch(fetchLibraryData());
navigate(
libMode === 'v1 only'
? '/libraries'
: '/libraries-v1',
);
navigate('/libraries-v1');
} else if (tab === TABS_LIST.libraries) {
navigate('/libraries');
} else if (tab === TABS_LIST.taxonomies) {
Expand Down

0 comments on commit 094086e

Please sign in to comment.