Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed May 27, 2024
2 parents 1d25fc0 + f0d7f82 commit 6654465
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pages/[prefix]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const Slug = props => {
return (
<>
<Layout {...props} />
{!lock && <Notification />}
{post?.password && post?.password !== '' && !lock && <Notification />}
</>
)
}
Expand Down
2 changes: 1 addition & 1 deletion themes/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export const initDarkMode = (updateDarkMode, defaultDarkMode) => {
const userDarkMode = loadDarkModeFromLocalStorage()
if (userDarkMode) {
newDarkMode = userDarkMode === 'dark' || userDarkMode === 'true'
saveDarkModeToLocalStorage(newDarkMode) //用户手动的才保存
}

// 如果站点强制设置默认深色,则优先级改过用
Expand All @@ -116,7 +117,6 @@ export const initDarkMode = (updateDarkMode, defaultDarkMode) => {
}

updateDarkMode(newDarkMode)
saveDarkModeToLocalStorage(newDarkMode)
document.getElementsByTagName('html')[0].setAttribute('class', newDarkMode ? 'dark' : 'light')
}

Expand Down

0 comments on commit 6654465

Please sign in to comment.