This commit is contained in:
parent
5b4116dfe7
commit
138daa7458
|
|
@ -13,12 +13,13 @@ export default function HomeRedirector() {
|
||||||
|
|
||||||
if (
|
if (
|
||||||
preferred &&
|
preferred &&
|
||||||
i18nConfig.locales.includes(preferred) &&
|
(i18nConfig.locales as string[]).includes(preferred) &&
|
||||||
!currentPath.startsWith(`/${preferred}/`)
|
!currentPath.startsWith(`/${preferred}/`)
|
||||||
) {
|
) {
|
||||||
const newPath = `/${preferred}${currentPath}`
|
const newPath = `/${preferred}${currentPath}`
|
||||||
router.replace(newPath)
|
router.replace(newPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return null
|
return null
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue