Skip to content

Commit 197b036

Browse files
committed
fix: avoid warning isSSR
1 parent 402288b commit 197b036

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/shared.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
Timestamp,
1010
} from 'firebase/firestore'
1111
import { StorageReference } from 'firebase/storage'
12-
import { inject, ssrContextKey } from 'vue-demi'
12+
import { getCurrentInstance, inject, ssrContextKey } from 'vue-demi'
1313
import type { Ref, ShallowRef } from 'vue-demi'
1414

1515
export const noop = () => {}
@@ -280,5 +280,5 @@ export interface _ResolveRejectFn {
280280
* @internal
281281
*/
282282
export function isSSR(): boolean {
283-
return !!inject(ssrContextKey, null)
283+
return !!(getCurrentInstance() && inject(ssrContextKey, null))
284284
}

0 commit comments

Comments
 (0)