router fix

This commit is contained in:
bniwredyc 2023-03-29 19:02:31 +02:00
parent f73456cea5
commit 5102b502b1
2 changed files with 10 additions and 5 deletions

View File

@ -270,7 +270,7 @@ export const FullArticle = (props: ArticleProps) => {
)} )}
</For> </For>
</div> </div>
<div ref={commentsRef}> <div>
<Show when={isReactionsLoaded()}> <Show when={isReactionsLoaded()}>
<CommentsTree <CommentsTree
shoutId={props.article.id} shoutId={props.article.id}

View File

@ -57,6 +57,15 @@ const handleClientRouteLinkClick = (event) => {
if (url.origin === location.origin) { if (url.origin === location.origin) {
event.preventDefault() event.preventDefault()
if (url.pathname) {
routerStore.open(url.pathname)
}
if (url.search) {
const params = Object.fromEntries(new URLSearchParams(url.search))
searchParamsStore.open(params)
}
if (url.hash) { if (url.hash) {
let selector = url.hash let selector = url.hash
@ -79,10 +88,6 @@ const handleClientRouteLinkClick = (event) => {
return return
} }
routerStore.open(url.pathname)
const params = Object.fromEntries(new URLSearchParams(url.search))
searchParamsStore.open(params)
window.scrollTo({ window.scrollTo({
top: 0, top: 0,
left: 0 left: 0