mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-17 07:26:46 +00:00
fix, Giscus
This commit is contained in:
@@ -16,12 +16,12 @@ const GiscusComponent = () => {
|
||||
const theme = isDarkMode ? 'dark' : 'light'
|
||||
useEffect(() => {
|
||||
loadExternalResource('/js/giscus.js', 'js').then(() => {
|
||||
if (window.Giscus) {
|
||||
window.Giscus.init('#giscus')
|
||||
if (window?.Giscus?.init) {
|
||||
window?.Giscus?.init('#giscus')
|
||||
}
|
||||
})
|
||||
return () => {
|
||||
window.Giscus.destroy()
|
||||
window?.Giscus?.destroy()
|
||||
}
|
||||
}, [isDarkMode])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user