diff --git a/frontend/src/components/Header/Layout.tsx b/frontend/src/components/Header/Layout.tsx index a79ca047..959d6166 100644 --- a/frontend/src/components/Header/Layout.tsx +++ b/frontend/src/components/Header/Layout.tsx @@ -29,7 +29,7 @@ export default function Layout(): JSX.Element { ) { navigate("/"); } - }, []); + }, [meData.loggedIn, location.pathname, navigate]); return ( <> @@ -39,7 +39,6 @@ export default function Layout(): JSX.Element { ); } - const useEnsureLangCodeInPath = () => { const location = useLocation(); const navigate = useNavigate(); @@ -54,5 +53,5 @@ const useEnsureLangCodeInPath = () => { const newPath = `/${langCode}/${pathParts.join("/")}`; navigate(newPath); } - }, [location, history, i18next.resolvedLanguage]); + }, [location, navigate]); }; \ No newline at end of file