diff --git a/frontend/static/js/index.js b/frontend/static/js/index.js index 91d1fee..10e72bd 100644 --- a/frontend/static/js/index.js +++ b/frontend/static/js/index.js @@ -33,7 +33,7 @@ const navigateTo = async (uri) => { history.pushState(null, null, uri); }; -const router = async (uri = "") => { +const router = async (uri) => { const routes = [ { path: "/", view: Dashboard }, { path: "/profiles", view: ProfilesView}, @@ -86,7 +86,7 @@ const router = async (uri = "") => { return 0; }; -window.addEventListener("popstate", router); +window.addEventListener("popstate", function() {router(this.location.pathname)}); document.addEventListener("DOMContentLoaded", () => { document.body.addEventListener("click", e => {