Fixed bug where 404 would freak out

This commit is contained in:
DrMint 2022-04-24 15:06:39 +02:00
parent fcd303fe6a
commit 9b162b0d49
1 changed files with 5 additions and 4 deletions

View File

@ -299,11 +299,12 @@ export default function AppLayout(props: Props): JSX.Element {
const preferredLanguages = [...items].map(
([code]) => code
);
console.log(router.asPath);
appLayout.setPreferredLanguages(preferredLanguages);
if (router.locale !== preferredLanguages[0]) {
router.push(router.asPath, router.asPath, {
locale: preferredLanguages[0],
});
}
}}
/>
)}