mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-24 23:16:52 +00:00
Merge branch 'main' into original-fix
This commit is contained in:
@@ -156,13 +156,14 @@ const LayoutPostList = props => {
|
||||
const LayoutSlug = props => {
|
||||
const { post, lock, validPassword } = props
|
||||
const router = useRouter()
|
||||
const waiting404 = siteConfig('POST_WAITING_TIME_FOR_404') * 1000
|
||||
useEffect(() => {
|
||||
// 404
|
||||
if (!post) {
|
||||
setTimeout(
|
||||
() => {
|
||||
if (isBrowser) {
|
||||
const article = document.getElementById('notion-article')
|
||||
const article = document.querySelector('#article-wrapper #notion-article')
|
||||
if (!article) {
|
||||
router.push('/404').then(() => {
|
||||
console.warn('找不到页面', router.asPath)
|
||||
@@ -170,7 +171,7 @@ const LayoutSlug = props => {
|
||||
}
|
||||
}
|
||||
},
|
||||
siteConfig('POST_WAITING_TIME_FOR_404') * 1000
|
||||
waiting404
|
||||
)
|
||||
}
|
||||
}, [post])
|
||||
@@ -178,11 +179,13 @@ const LayoutSlug = props => {
|
||||
<>
|
||||
{lock ? (
|
||||
<PostLock validPassword={validPassword} />
|
||||
) : (
|
||||
<div id='article-wrapper'>
|
||||
) : post && (
|
||||
<div>
|
||||
<PostMeta post={post} />
|
||||
<NotionPage post={post} />
|
||||
<ShareBar post={post} />
|
||||
<div id='article-wrapper'>
|
||||
<NotionPage post={post} />
|
||||
<ShareBar post={post} />
|
||||
</div>
|
||||
<Comment frontMatter={post} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user