From 95b9358c0d5c1744af7929978d3e7dca0fabf92b 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 8475a167..32c2bf2b 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)