From 173ec240d2ed5b25f18ef42823334ae800b3527d Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 20 Aug 2023 17:50:56 -0700 Subject: [PATCH] fix: jump to anchor on deployed site triggering spa refresh --- quartz/components/scripts/spa.inline.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/quartz/components/scripts/spa.inline.ts b/quartz/components/scripts/spa.inline.ts index 8475a16..32c2bf2 100644 --- a/quartz/components/scripts/spa.inline.ts +++ b/quartz/components/scripts/spa.inline.ts @@ -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)