Skip to content

Commit

Permalink
fix: avoid pushing to history when clicking on the current link (#3405)
Browse files Browse the repository at this point in the history
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
  • Loading branch information
zonemeen and brc-dd committed Jan 3, 2024
1 parent 1ff1534 commit d279e63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/app/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ function shouldHotReload(payload: PageDataPayload): boolean {
}

function updateHistory(href: string) {
if (inBrowser && href !== normalizeHref(location.href)) {
if (inBrowser && normalizeHref(href) !== normalizeHref(location.href)) {
// save scroll position before changing url
history.replaceState({ scrollPosition: window.scrollY }, document.title)
history.pushState(null, '', href)
Expand Down

0 comments on commit d279e63

Please sign in to comment.