feat(SW-1347): SidePeekProvider is now using '#s-' instead of '?s='

This commit is contained in:
Erik Tiekstra
2025-01-10 12:01:42 +01:00
parent c82b6866e7
commit 96820ba89a
7 changed files with 22 additions and 39 deletions
+2 -15
View File
@@ -8,21 +8,8 @@ export default function useHash() {
const params = useParams()
useEffect(() => {
const updateHash = () => {
const newHash = window.location.hash
? window.location.hash.slice(1)
: undefined
setHash(newHash)
}
updateHash()
window.addEventListener("hashchange", updateHash)
return () => {
window.removeEventListener("hashchange", updateHash)
}
setHash(window.location.hash)
}, [params])
return hash
return hash?.slice(1)
}