fix: history.pushState before router

This commit is contained in:
2024-02-13 14:19:12 +01:00
parent c8cb25b0fc
commit b398134101
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');