From 9d403c861f8c6eec40bf1516647efc904f3080d1 Mon Sep 17 00:00:00 2001 From: vcoppe Date: Fri, 16 Aug 2024 12:58:24 +0200 Subject: [PATCH] fix embedding redirect --- website/src/routes/+layout.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/src/routes/+layout.svelte b/website/src/routes/+layout.svelte index fd405223..d103e363 100644 --- a/website/src/routes/+layout.svelte +++ b/website/src/routes/+layout.svelte @@ -11,6 +11,7 @@ import { languages } from '$lib/languages'; import { browser } from '$app/environment'; import { goto } from '$app/navigation'; + import { getURLForLanguage } from '$lib/utils'; const appRoutes = ['/[[language]]/app', '/[[language]]/embed']; @@ -18,7 +19,7 @@ if ($page.url.searchParams.has('embed')) { // convert old embedding options to new format and redirect to new embed page let locale = $page.url.pathname.split('/')[1] ?? 'en'; - window.location.href = `${base}${locale ? '/' + locale : ''}/embed?options=${encodeURIComponent(JSON.stringify(convertOldEmbeddingOptions($page.url.searchParams)))}`; + window.location.href = `${getURLForLanguage(locale, '/embed')}?options=${encodeURIComponent(JSON.stringify(convertOldEmbeddingOptions($page.url.searchParams)))}`; } });