mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 23:16:49 +00:00
bug:密码一闪而过
This commit is contained in:
@@ -19,9 +19,9 @@ const Slug = props => {
|
||||
}
|
||||
|
||||
// 文章锁🔐
|
||||
const [lock, setLock] = useState(true)
|
||||
const [lock, setLock] = useState(post.password && post.password !== '')
|
||||
useEffect(() => {
|
||||
if (post && post.password && post.password !== '') {
|
||||
if (post.password && post.password !== '') {
|
||||
setLock(true)
|
||||
} else {
|
||||
setLock(false)
|
||||
|
||||
@@ -35,9 +35,10 @@ const Slug = props => {
|
||||
}
|
||||
|
||||
// 文章锁🔐
|
||||
const [lock, setLock] = useState(true)
|
||||
const [lock, setLock] = useState(post.password && post.password !== '')
|
||||
console.log('lock 默认值', lock)
|
||||
useEffect(() => {
|
||||
if (post && post.password && post.password !== '') {
|
||||
if (post.password && post.password !== '') {
|
||||
setLock(true)
|
||||
} else {
|
||||
setLock(false)
|
||||
|
||||
Reference in New Issue
Block a user