From f0cbabdf780b57efaf79a366298dc7d4e9693e5b Mon Sep 17 00:00:00 2001 From: zonemeen Date: Wed, 3 Jan 2024 20:26:04 +0800 Subject: [PATCH] fix: click on same internal a tag to avoid history pushState triggering multiple times --- src/client/app/router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/app/router.ts b/src/client/app/router.ts index 02d98944..89d1fe2b 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -329,7 +329,7 @@ function shouldHotReload(payload: PageDataPayload): boolean { } function updateHistory(href: string) { - if (inBrowser && href !== normalizeHref(location.href)) { + if (inBrowser && href !== location.href) { // save scroll position before changing url history.replaceState({ scrollPosition: window.scrollY }, document.title) history.pushState(null, '', href)