Skip to content

Commit

Permalink
fix: fix artalk instance initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsang4 committed Jan 31, 2024
1 parent c13133c commit ad08ae9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Comments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export const Comments = (props: Props) => {
const { className, style, pageKey, pageTitle, commentServer } = props

useEffect(() => {
;(window as any).Artalk.init({
const artalk = (window as any).Artalk.init({
el: "#comments",
pageKey,
pageTitle,
server: commentServer,
site: SITE.title,
})
const theme = localStorage.getItem("theme") as string
;(window as any).Artalk.setDarkMode(theme === "dark")
artalk.setDarkMode(theme === "dark")
}, [])

return <div className={className} style={style} id="comments"></div>
Expand Down

0 comments on commit ad08ae9

Please sign in to comment.