mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-25 21:16:21 +00:00
fix: jump to anchor on deployed site triggering spa refresh
This commit is contained in:
parent
425c9789a4
commit
173ec240d2
1 changed files with 1 additions and 0 deletions
|
@ -94,6 +94,7 @@ function createRouter() {
|
||||||
window.addEventListener("click", async (event) => {
|
window.addEventListener("click", async (event) => {
|
||||||
const { url } = getOpts(event) ?? {}
|
const { url } = getOpts(event) ?? {}
|
||||||
if (!url) return
|
if (!url) return
|
||||||
|
if (url.pathname === window.location.pathname) return
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
try {
|
try {
|
||||||
navigate(url, false)
|
navigate(url, false)
|
||||||
|
|
Loading…
Reference in a new issue