From 13a997e2729e0f72c4054d0f14eb8fed8329e49f Mon Sep 17 00:00:00 2001 From: vcoppe Date: Mon, 8 Jul 2024 23:39:45 +0200 Subject: [PATCH] fix urls with base --- website/src/lib/components/toolbar/tools/routing/Routing.ts | 2 +- website/src/lib/utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/src/lib/components/toolbar/tools/routing/Routing.ts b/website/src/lib/components/toolbar/tools/routing/Routing.ts index dd785565..07af9229 100644 --- a/website/src/lib/components/toolbar/tools/routing/Routing.ts +++ b/website/src/lib/components/toolbar/tools/routing/Routing.ts @@ -17,7 +17,7 @@ export const brouterProfiles: { [key: string]: string } = { railway: 'rail' }; export const routingProfileSelectItem = writable({ - value: '', + value: 'bike', label: '' }); diff --git a/website/src/lib/utils.ts b/website/src/lib/utils.ts index 1153718b..3c535799 100644 --- a/website/src/lib/utils.ts +++ b/website/src/lib/utils.ts @@ -95,7 +95,7 @@ export function setCrosshairCursor() { } export function getURLForLanguage(lang: string | null | undefined, path?: string): string { - let newPath = path ?? (browser ? window.location.pathname : ''); + let newPath = path ?? (browser ? window.location.pathname.replace(base, '') : ''); let languageInPath = newPath.split('/')[1]; if (!languages.hasOwnProperty(languageInPath)) { languageInPath = 'en';