Skip to content

Commit

Permalink
fix: avoid warning isSSR
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Nov 25, 2022
1 parent 402288b commit 197b036
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Timestamp,
} from 'firebase/firestore'
import { StorageReference } from 'firebase/storage'
import { inject, ssrContextKey } from 'vue-demi'
import { getCurrentInstance, inject, ssrContextKey } from 'vue-demi'
import type { Ref, ShallowRef } from 'vue-demi'

export const noop = () => {}
Expand Down Expand Up @@ -280,5 +280,5 @@ export interface _ResolveRejectFn {
* @internal
*/
export function isSSR(): boolean {
return !!inject(ssrContextKey, null)
return !!(getCurrentInstance() && inject(ssrContextKey, null))
}

0 comments on commit 197b036

Please sign in to comment.