修改loading逻辑

This commit is contained in:
tangly1024
2022-12-07 12:22:22 +08:00
parent eae584d0eb
commit cb86beec20

View File

@@ -24,6 +24,7 @@ const Slug = props => {
const [lock, setLock] = React.useState(post?.password && post?.password !== '')
React.useEffect(() => {
changeLoadingState(false)
if (post?.password && post?.password !== '') {
setLock(true)
} else {
@@ -32,7 +33,6 @@ const Slug = props => {
}, [post])
if (!post) {
changeLoadingState(true)
setTimeout(() => {
if (isBrowser()) {
const article = document.getElementById('container')
@@ -47,8 +47,6 @@ const Slug = props => {
return <ThemeComponents.LayoutSlug {...props} showArticleInfo={true} meta={meta} />
}
changeLoadingState(false)
/**
* 验证文章密码
* @param {*} result