diff options
Diffstat (limited to 'asset-sources/fietsboek.ts')
-rw-r--r-- | asset-sources/fietsboek.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/asset-sources/fietsboek.ts b/asset-sources/fietsboek.ts index 1073ae4..d9d2c15 100644 --- a/asset-sources/fietsboek.ts +++ b/asset-sources/fietsboek.ts @@ -1,4 +1,5 @@ declare const FRIENDS_URL: string; +declare const BASE_URL: string; declare const LOCALE: string; /** @@ -57,8 +58,9 @@ function addHandler<K extends keyof GlobalEventHandlersEventMap>( * @param event - The triggering event. */ function languageClicked(event: MouseEvent) { + const path = new URL(BASE_URL).pathname; const language = (event.target as HTMLElement).getAttribute("data-langcode"); - document.cookie = "fietsboek_locale=" + language; + document.cookie = `fietsboek_locale=${language}; Path=${path}`; window.location.reload(); event.preventDefault(); } |