Skip to content

Commit 1553dbc

Browse files
authoredJan 21, 2023
fix(router): avoid duplicate history entries (#1827)
1 parent 5d2fc3f commit 1553dbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/client/app/router.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function createRouter(
5757
href = url.pathname + url.search + url.hash
5858
}
5959
}
60-
if (inBrowser) {
60+
if (inBrowser && href !== location.href) {
6161
// save scroll position before changing url
6262
history.replaceState({ scrollPosition: window.scrollY }, document.title)
6363
history.pushState(null, '', href)

0 commit comments

Comments
 (0)
Please sign in to comment.