fix: history.pushState before router

This commit is contained in:
starnakin 2024-02-13 14:19:12 +01:00 committed by AdrienLSH
parent 1625f5d69f
commit 5ba1dbc387
2 changed files with 4 additions and 3 deletions

View File

@ -36,11 +36,12 @@ const getParams = match => {
};
const navigateTo = async (uri) => {
if (await router(uri) !== 0)
return;
history.pushState(null, null, uri);
if (await router(uri) !== 0)
return;
let link = document.querySelector('a[href=\'' + location.pathname + '\']');
if (link) {
document.querySelector('[data-link].active')?.classList.remove('active');

View File

@ -107,7 +107,7 @@ export default class extends AbstractNonAuthenticatedView
let toggle_register_login_text = this.current_mode === "register" ? "registerLogin" : "loginRegister";
toggle_register_login.innerText = lang.get(toggle_register_login_text, "ERROR LANG");
let button_text = this.current_mode === "login" ? "loginFormButton" : "registerFormButton";
let button_text = this.current_mode === "register" ? "registerFormButton" : "loginFormButton";
button.innerText = lang.get(button_text, "ERROR LANG");
}