]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
feat: avoid missing injection not found in edge Vue 2 edge case (#1849)
authorXRenSiu <xrensiu@gmail.com>
Fri, 9 Dec 2022 10:23:43 +0000 (18:23 +0800)
committerGitHub <noreply@github.com>
Fri, 9 Dec 2022 10:23:43 +0000 (11:23 +0100)
Related to #1650

packages/pinia/src/store.ts

index 98d77a266636ba326e5f0d8c0bae533ef086c0db..e4be1beba42bc3fca42c5aa442f8716d61d5d4c0 100644 (file)
@@ -886,7 +886,7 @@ export function defineStore(
       // in test mode, ignore the argument provided as we can always retrieve a
       // pinia instance with getActivePinia()
       (__TEST__ && activePinia && activePinia._testing ? null : pinia) ||
-      (currentInstance && inject(piniaSymbol))
+      (currentInstance && inject(piniaSymbol, null))
     if (pinia) setActivePinia(pinia)
 
     if (__DEV__ && !activePinia) {