fix 修复heo主题从NotionConfig读取失败Bug

默认从NotionConfig读取为字符串,此时会导致notices获取失败
This commit is contained in:
Heathcliff
2023-11-14 15:33:04 +08:00
committed by GitHub
parent 2ebd3fdaa3
commit e04128ed4c

View File

@@ -8,8 +8,10 @@ import { siteConfig } from '@/lib/config'
* 通知横幅
*/
export function NoticeBar() {
const notices = siteConfig('HEO_NOTICE_BAR', null, CONFIG)
let notices = siteConfig('HEO_NOTICE_BAR', null, CONFIG)
if (typeof notices === 'string') {
notices = JSON.parse(notices)
}
if (!notices || notices?.length === 0) {
return <></>
}