Skip to content

Commit

Permalink
fix: to top
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 2, 2023
1 parent ff1183e commit 7f6fe84
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/posts/(post-detail)/[category]/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { ArticleRightAside } from '~/components/widgets/shared/ArticleRightAside
import { SubscribeBell } from '~/components/widgets/subscribe/SubscribeBell'
import { XLogInfoForPost, XLogSummaryForPost } from '~/components/widgets/xlog'
import { noopArr } from '~/lib/noop'
import { springScrollToTop } from '~/lib/scroller'
import { MarkdownImageRecordProvider } from '~/providers/article/MarkdownImageRecordProvider'
import { useCurrentPostDataSelector } from '~/providers/post/CurrentPostDataProvider'
import { LayoutRightSidePortal } from '~/providers/shared/LayoutRightSideProvider'
Expand All @@ -28,6 +29,10 @@ const PostPage = () => {
const id = useCurrentPostDataSelector((p) => p?.id)
const title = useCurrentPostDataSelector((p) => p?.title)

useEffect(() => {
springScrollToTop()
}, [id])

if (!id) {
return <Loading />
}
Expand Down

1 comment on commit 7f6fe84

@vercel
Copy link

@vercel vercel bot commented on 7f6fe84 Jul 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

shiro – ./

springtide.vercel.app
innei.in
shiro-git-main-innei.vercel.app
shiro-innei.vercel.app

Please sign in to comment.