Skip to content

Commit

Permalink
fix, Giscus
Browse files Browse the repository at this point in the history
  • Loading branch information
tangly1024 committed Apr 12, 2024
1 parent cf68df2 commit 0406669
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/Giscus.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down

0 comments on commit 0406669

Please sign in to comment.