feat(SW-1347): SidePeekProvider is now using '#s-' instead of '?s='
This commit is contained in:
+2
-15
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user