fix: click on same internal a tag to avoid history pushState triggering multiple times

pull/3405/head
zonemeen 2 years ago
parent 1ff1534e19
commit f0cbabdf78

@ -329,7 +329,7 @@ function shouldHotReload(payload: PageDataPayload): boolean {
} }
function updateHistory(href: string) { function updateHistory(href: string) {
if (inBrowser && href !== normalizeHref(location.href)) { if (inBrowser && href !== location.href) {
// save scroll position before changing url // save scroll position before changing url
history.replaceState({ scrollPosition: window.scrollY }, document.title) history.replaceState({ scrollPosition: window.scrollY }, document.title)
history.pushState(null, '', href) history.pushState(null, '', href)

Loading…
Cancel
Save