Skip to content

Commit

Permalink
fix(useNProgress): improve SSR support (#1990)
Browse files Browse the repository at this point in the history
  • Loading branch information
webfansplz committed Jul 25, 2022
1 parent e71cbd3 commit a33a244
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/integrations/useNProgress/index.ts
@@ -1,7 +1,7 @@
import type { NProgressOptions } from 'nprogress'
import nprogress from 'nprogress'
import type { MaybeComputedRef } from '@vueuse/shared'
import { isNumber, tryOnScopeDispose } from '@vueuse/shared'
import { isClient, isNumber, tryOnScopeDispose } from '@vueuse/shared'
import { computed, ref, watchEffect } from 'vue-demi'

export type UseNProgressOptions = Partial<NProgressOptions>
Expand Down Expand Up @@ -31,7 +31,7 @@ export function useNProgress(
}

watchEffect(() => {
if (isNumber(progress.value))
if (isNumber(progress.value) && isClient)
setProgress.call(nprogress, progress.value)
})

Expand Down

0 comments on commit a33a244

Please sign in to comment.