use addEventListener

This commit is contained in:
Austin Mroz
2025-12-12 13:09:54 -08:00
parent 8f0da317ec
commit 1027ec5395

View File

@@ -160,11 +160,10 @@ export const useSubgraphNavigationStore = defineStore(
//Allow navigation with forward/back buttons
const routeHash = ref(window.location.hash)
const originalOnHashChange = window.onhashchange
window.onhashchange = (...args) => {
routeHash.value = window.location.hash
return originalOnHashChange?.apply(window, args)
}
addEventListener(
'hashchange',
() => (routeHash.value = window.location.hash)
)
let blockHashUpdate = false
let initialLoad = true