router fix
This commit is contained in:
parent
f73456cea5
commit
5102b502b1
|
@ -270,7 +270,7 @@ export const FullArticle = (props: ArticleProps) => {
|
|||
)}
|
||||
</For>
|
||||
</div>
|
||||
<div ref={commentsRef}>
|
||||
<div>
|
||||
<Show when={isReactionsLoaded()}>
|
||||
<CommentsTree
|
||||
shoutId={props.article.id}
|
||||
|
|
|
@ -57,6 +57,15 @@ const handleClientRouteLinkClick = (event) => {
|
|||
if (url.origin === location.origin) {
|
||||
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) {
|
||||
let selector = url.hash
|
||||
|
||||
|
@ -79,10 +88,6 @@ const handleClientRouteLinkClick = (event) => {
|
|||
return
|
||||
}
|
||||
|
||||
routerStore.open(url.pathname)
|
||||
const params = Object.fromEntries(new URLSearchParams(url.search))
|
||||
searchParamsStore.open(params)
|
||||
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
left: 0
|
||||
|
|
Loading…
Reference in New Issue
Block a user