mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
fix: legacy redirector ensure props
This commit is contained in:
1 parent
9a3f64fcd6
commit
12e645f6e2
4 files changed
+9
-7
No files matched your search
@@ -4,11 +4,11 @@
|
||||
|
||||
const isAPI = window.location.pathname.startsWith("/api");
|
||||
const isI18nPath = locales.supported.some(({ locale }) =>
|
||||
window.location.pathname.startsWith(`/${locale}/`)
|
||||
window.location.pathname.startsWith(`/${locale}/`),
|
||||
);
|
||||
const bestLocale = getBestLocale();
|
||||
const currentPath = locales.supported.find(({ locale }) =>
|
||||
window.location.pathname.startsWith(`/${locale}/`)
|
||||
window.location.pathname.startsWith(`/${locale}/`),
|
||||
);
|
||||
|
||||
if (
|
||||
@@ -19,8 +19,8 @@
|
||||
window.location.pathname = isI18nPath
|
||||
? window.location.pathname.replace(
|
||||
`/${currentPath?.locale}`,
|
||||
bestLocale === undefined ? "" : `/${bestLocale}`
|
||||
bestLocale === undefined ? "" : `/${bestLocale}`,
|
||||
)
|
||||
: `${bestLocale ? `/${bestLocale}` : ""}${window.location.pathname}`;
|
||||
: `${bestLocale}${window.location.pathname}`;
|
||||
}
|
||||
</script>
|
||||
Reference in new issue
Block a user