Skip to content

Commit

Permalink
fix: fix server build
Browse files Browse the repository at this point in the history
  • Loading branch information
ntnyq committed Jan 5, 2025
1 parent 8fddcaa commit 74ed846
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/client/components/SocialShareNetwork.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useDarkmode } from '@vuepress/helper/client'
import { computed, defineComponent, h } from 'vue'
import { isString } from '../../shared/index.js'
import { isSVG } from '../utils.js'
import { inBrowser, isSVG } from '../utils.js'
import type { PropType } from 'vue'
import type { SocialShareNetworkWithName } from '../../shared/index.js'

Expand Down Expand Up @@ -39,7 +39,11 @@ export const SocialShareNetwork = defineComponent({
emits: [Event.Share],

setup(props, ctx) {
const isDarkMode = computed(() => useDarkmode().value)
const isDarkMode = computed(() => {
// workaround for document is undefined
if (!inBrowser) return false
return useDarkmode().value
})
const resolvedIcon = computed(() => {
const { icon } = props.network
if (isString(icon)) return icon
Expand Down

0 comments on commit 74ed846

Please sign in to comment.