From 85787760b9ab9576b9103cb0711498ff69835abb Mon Sep 17 00:00:00 2001 From: starnakin Date: Mon, 11 Dec 2023 15:54:56 +0100 Subject: [PATCH] fix: back button is back --- frontend/static/js/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/static/js/index.js b/frontend/static/js/index.js index c263079..9501016 100644 --- a/frontend/static/js/index.js +++ b/frontend/static/js/index.js @@ -32,7 +32,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}, @@ -84,7 +84,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 => {