fix: jump to anchor on deployed site triggering spa refresh

This commit is contained in:
Jacky Zhao committed 2023-08-20 17:50:56 -07:00
1 parent 425c9789a4
commit 173ec240d2
1 file changed
+1
+1
View File
@@ -94,6 +94,7 @@ function createRouter() {
window.addEventListener("click", async (event) => {
const { url } = getOpts(event) ?? {}
if (!url) return
if (url.pathname === window.location.pathname) return
event.preventDefault()
try {
navigate(url, false)