Skip to content

Commit

Permalink
optimize: optimize comment lib loading
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsang4 committed Apr 27, 2024
1 parent 62e75f9 commit b5e35bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/Comments.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { CSSProperties } from "react"
import { useEffect } from "react"
import { SITE } from "@config"
import { init } from "artalk"
import "artalk/dist/Artalk.css"

type Props = {
className?: string
Expand All @@ -15,8 +17,6 @@ export const Comments = (props: Props) => {

useEffect(() => {
const initComment = async () => {
import("artalk/dist/Artalk.css")
const { init } = await import("artalk")
const artalk = init({
el: "#comments",
pageKey,
Expand Down
1 change: 0 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { ArtalkConfig } from "artalk"
import type Artalk from "artalk"

export type SocialObjects = {
Expand Down

0 comments on commit b5e35bd

Please sign in to comment.