From 1553dbce8eac9ed4a65312d4590d6b0f9261135c Mon Sep 17 00:00:00 2001 From: Em Zhan Date: Sat, 21 Jan 2023 09:43:16 -0600 Subject: [PATCH] fix(router): avoid duplicate history entries (#1827) --- 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 de55ab42..8b097254 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -57,7 +57,7 @@ export function createRouter( href = url.pathname + url.search + url.hash } } - if (inBrowser) { + if (inBrowser && href !== location.href) { // save scroll position before changing url history.replaceState({ scrollPosition: window.scrollY }, document.title) history.pushState(null, '', href)