From e68dccbc172ed36762fc0c5b64846ebe855981e9 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Fri, 15 Jan 2021 21:16:11 +0000 Subject: [PATCH] keep language choice in url when changing tabs --- ts/admin.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ts/admin.ts b/ts/admin.ts index d47b6c16..c73044b3 100644 --- a/ts/admin.ts +++ b/ts/admin.ts @@ -94,12 +94,17 @@ if (window.location.pathname == "/") { } document.addEventListener("tab-change", (event: CustomEvent) => { + const urlParams = new URLSearchParams(window.location.search); + const lang = urlParams.get('lang'); let tab = "/" + event.detail; if (tab == "/invites") { if (window.location.pathname == "/") { tab = "/"; } else { tab = "../"; } } + if (lang) { + tab += "?lang=" + lang + } window.history.replaceState("", "Admin - jfa-go", tab); });