Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Jan 22, 2025
1 parent 8d8f451 commit 93abc90
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/client/app/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,8 @@ export function createRouter(
})
)

if (hash) {
scrollTo(
hash,
cause ? cause.classList.contains('header-anchor') : false
)
} else {
window.scrollTo(0, 0)
}
if (hash) scrollTo(hash, cause?.classList.contains('header-anchor'))
else window.scrollTo(0, 0)
}

return
Expand Down Expand Up @@ -156,11 +150,8 @@ export function createRouter(
history.replaceState({}, '', href)
}

if (targetLoc.hash && !scrollPosition) {
scrollTo(targetLoc.hash)
} else {
window.scrollTo(0, scrollPosition)
}
if (targetLoc.hash && !scrollPosition) scrollTo(targetLoc.hash)
else window.scrollTo(0, scrollPosition)
})
}
}
Expand Down

0 comments on commit 93abc90

Please sign in to comment.