Skip to content

Commit

Permalink
细节调整
Browse files Browse the repository at this point in the history
  • Loading branch information
tangly1024 committed Sep 5, 2024
1 parent c351b76 commit 1610ab6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions components/OpenWrite.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { siteConfig } from '@/lib/config'
import { isBrowser, loadExternalResource } from '@/lib/utils'
import { useRouter } from 'next/router'
import { useEffect } from 'react'
/**
* OpenWrite公众号导流插件
Expand All @@ -9,7 +8,6 @@ import { useEffect } from 'react'
* @returns
*/
const OpenWrite = () => {
const router = useRouter()
const qrcode = siteConfig('OPEN_WRITE_QRCODE', '请配置公众号二维码')
const blogId = siteConfig('OPEN_WRITE_BLOG_ID')
const name = siteConfig('OPEN_WRITE_NAME', '请配置公众号名')
Expand Down Expand Up @@ -47,7 +45,13 @@ const OpenWrite = () => {

useEffect(() => {
if (isBrowser && blogId) {
loadOpenWrite()
// Check if the element with id 'read-more-wrap' already exists
const readMoreWrap = document.getElementById('read-more-wrap')

// Only load the script if the element doesn't exist
if (!readMoreWrap) {
loadOpenWrite()
}
}
})

Expand Down

0 comments on commit 1610ab6

Please sign in to comment.