use base in embed redirect

This commit is contained in:
vcoppe
2024-08-14 16:35:35 +02:00
parent cfa40238e4
commit f34b23253e

View File

@@ -8,6 +8,7 @@
import Footer from '$lib/components/Footer.svelte';
import { onMount } from 'svelte';
import { convertOldEmbeddingOptions } from '$lib/components/embedding/Embedding';
import { base } from '$app/paths';
const appRoutes = ['/[[language]]/app', '/[[language]]/embed'];
@@ -15,7 +16,7 @@
if ($page.url.searchParams.has('embed')) {
// convert old embedding options to new format and redirect to new embed page
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)))}`;
}
});