mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-08-31 23:53:25 +00:00
use base in embed redirect
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
import Footer from '$lib/components/Footer.svelte';
|
import Footer from '$lib/components/Footer.svelte';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { convertOldEmbeddingOptions } from '$lib/components/embedding/Embedding';
|
import { convertOldEmbeddingOptions } from '$lib/components/embedding/Embedding';
|
||||||
|
import { base } from '$app/paths';
|
||||||
|
|
||||||
const appRoutes = ['/[[language]]/app', '/[[language]]/embed'];
|
const appRoutes = ['/[[language]]/app', '/[[language]]/embed'];
|
||||||
|
|
||||||
@@ -15,7 +16,7 @@
|
|||||||
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.params.language;
|
let locale = $page.params.language;
|
||||||
window.location.href = `${locale ? '/' + locale : ''}/embed?options=${encodeURIComponent(JSON.stringify(convertOldEmbeddingOptions($page.url.searchParams)))}`;
|
window.location.href = `${base}${locale ? '/' + locale : ''}/embed?options=${encodeURIComponent(JSON.stringify(convertOldEmbeddingOptions($page.url.searchParams)))}`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user