Skip to content

Commit

Permalink
fixed url flickering
Browse files Browse the repository at this point in the history
  • Loading branch information
AronBuzogany committed May 23, 2024
1 parent ab3aea3 commit ad533ba
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions frontend/src/components/Header/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ export default function Layout(): JSX.Element {
!meData.loggedIn &&
!(
location.pathname === "/" ||
/\/([a-z]{2})?\/home/.test(location.pathname)
/\/([a-z]{2})\/home/.test(location.pathname) ||
location.pathname === `/${i18next.resolvedLanguage}`
)
) {
navigate("/");
navigate(`${i18next.resolvedLanguage}/home`);
}
}, [meData.loggedIn, location.pathname, navigate]);

Expand All @@ -54,4 +55,4 @@ const useEnsureLangCodeInPath = () => {
navigate(newPath);
}
}, [location, navigate]);
};
};

0 comments on commit ad533ba

Please sign in to comment.