Skip to content

Commit

Permalink
keep language choice in url when changing tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
hrfee committed Jan 15, 2021
1 parent ffc6257 commit e68dccb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ts/admin.ts
Expand Up @@ -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);
});

Expand Down

0 comments on commit e68dccb

Please sign in to comment.