From 58470f7dbac17c8ff485fb9e5413f64e4a0036eb Mon Sep 17 00:00:00 2001 From: joshuaboud Date: Mon, 30 May 2022 13:19:39 -0300 Subject: [PATCH] update window.location.hash directly instead of cockpit.location.go --- navigator/src/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/navigator/src/main.js b/navigator/src/main.js index 4ab33a8..0f18ac1 100644 --- a/navigator/src/main.js +++ b/navigator/src/main.js @@ -39,7 +39,7 @@ router.beforeEach(async (to, from) => { if (to.name === 'root') return `/browse${localStorage.getItem(lastPathStorageKey) ?? '/'}`; if (to.fullPath === lastValidRoutePath) { - return true; + return true; // ignore from updating window.location.hash } if (to.name === 'browse') { if (!to.params.path) @@ -61,7 +61,7 @@ router.beforeEach(async (to, from) => { } } lastValidRoutePath = to.fullPath; // protect double-update from next line - cockpit.location.go(to.fullPath); // needed to update URL in address bar + window.location.hash = '#' + to.fullPath; // needed to update URL in address bar return true; })