mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-07 15:10:32 +00:00
修改loading逻辑
This commit is contained in:
@@ -24,6 +24,7 @@ const Slug = props => {
|
|||||||
const [lock, setLock] = React.useState(post?.password && post?.password !== '')
|
const [lock, setLock] = React.useState(post?.password && post?.password !== '')
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
|
changeLoadingState(false)
|
||||||
if (post?.password && post?.password !== '') {
|
if (post?.password && post?.password !== '') {
|
||||||
setLock(true)
|
setLock(true)
|
||||||
} else {
|
} else {
|
||||||
@@ -32,7 +33,6 @@ const Slug = props => {
|
|||||||
}, [post])
|
}, [post])
|
||||||
|
|
||||||
if (!post) {
|
if (!post) {
|
||||||
changeLoadingState(true)
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (isBrowser()) {
|
if (isBrowser()) {
|
||||||
const article = document.getElementById('container')
|
const article = document.getElementById('container')
|
||||||
@@ -47,8 +47,6 @@ const Slug = props => {
|
|||||||
return <ThemeComponents.LayoutSlug {...props} showArticleInfo={true} meta={meta} />
|
return <ThemeComponents.LayoutSlug {...props} showArticleInfo={true} meta={meta} />
|
||||||
}
|
}
|
||||||
|
|
||||||
changeLoadingState(false)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证文章密码
|
* 验证文章密码
|
||||||
* @param {*} result
|
* @param {*} result
|
||||||
|
|||||||
Reference in New Issue
Block a user