From 359d78e4d851a8d317564c91996eab27c994fa5d Mon Sep 17 00:00:00 2001 From: AdrienLSH Date: Mon, 15 Jan 2024 13:50:03 +0100 Subject: [PATCH] fix: navbar links --- frontend/static/js/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/static/js/index.js b/frontend/static/js/index.js index 5b5247e..fa5eda6 100644 --- a/frontend/static/js/index.js +++ b/frontend/static/js/index.js @@ -125,7 +125,7 @@ const router = async(uri) => { window.addEventListener("popstate", function() {router(location.pathname)}); -document.addEventListener("DOMContentLoaded", () => { +document.addEventListener("DOMContentLoaded", async () => { document.body.addEventListener("click", e => { if (e.target.matches("[data-link]")) { e.preventDefault(); @@ -136,6 +136,7 @@ document.addEventListener("DOMContentLoaded", () => { navigateTo(e.target.href.slice(location.origin.length)); } }); + await client.isAuthentificate(); router(location.pathname); document.querySelector('a[href=\'' + location.pathname + '\']')?.classList.add('active'); });