mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-02 00:32:33 +00:00
fix embedding redirect
This commit is contained in:
@@ -18,7 +18,8 @@
|
|||||||
onMount(() => {
|
onMount(() => {
|
||||||
if ($page.url.searchParams.has('embed')) {
|
if ($page.url.searchParams.has('embed')) {
|
||||||
// convert old embedding options to new format and redirect to new embed page
|
// convert old embedding options to new format and redirect to new embed page
|
||||||
let locale = $page.url.pathname.split('/')[1] ?? 'en';
|
let folders = $page.url.pathname.split('/');
|
||||||
|
let locale = folders.indexOf('l') >= 0 ? folders[folders.indexOf('l') + 1] ?? 'en' : 'en';
|
||||||
window.location.href = `${getURLForLanguage(locale, '/embed')}?options=${encodeURIComponent(JSON.stringify(convertOldEmbeddingOptions($page.url.searchParams)))}`;
|
window.location.href = `${getURLForLanguage(locale, '/embed')}?options=${encodeURIComponent(JSON.stringify(convertOldEmbeddingOptions($page.url.searchParams)))}`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user