Skip to content

Commit

Permalink
bug: fixed condition for redirect to trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
mheggelund committed Nov 13, 2023
1 parent 1258888 commit 3012fd1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/features/AppBar/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ export const Navigation = () => {
);

useEffect(() => {
if (!active) navigate('models');
}, [active, navigate]);
const currentURL = window.location.pathname;
if (currentURL === '/') navigate('models');
}, [navigate]);

function clickTab(tab: number) {
navigate(tabs[tab].path);
Expand Down

0 comments on commit 3012fd1

Please sign in to comment.