From: XRenSiu Date: Fri, 9 Dec 2022 10:23:43 +0000 (+0800) Subject: feat: avoid missing injection not found in edge Vue 2 edge case (#1849) X-Git-Tag: pinia@2.0.28~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78ec9a186dcbce3d583db332ae22094a182358cc;p=thirdparty%2Fvuejs%2Fpinia.git feat: avoid missing injection not found in edge Vue 2 edge case (#1849) Related to #1650 --- diff --git a/packages/pinia/src/store.ts b/packages/pinia/src/store.ts index 98d77a26..e4be1beb 100644 --- a/packages/pinia/src/store.ts +++ b/packages/pinia/src/store.ts @@ -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) {