File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -104,9 +104,10 @@ export function databasePlugin(
104104 effectScope ( )
105105 ) !
106106
107- const { promise, stop : _unbind } = scope . run ( ( ) =>
108- _useDatabaseRef ( source , { target, ...options } )
109- ) !
107+ // add access to global inject
108+ const { promise, stop : _unbind } = app . runWithContext (
109+ ( ) => scope . run ( ( ) => _useDatabaseRef ( source , { target, ...options } ) ) !
110+ )
110111
111112 // override the unbind to also free th variables created
112113 const unbind : UnbindWithReset = ( reset ) => {
Original file line number Diff line number Diff line change @@ -104,12 +104,16 @@ export const firestorePlugin = function firestorePlugin(
104104 effectScope ( )
105105 ) !
106106
107- const { promise, stop : _unbind } = scope . run ( ( ) =>
108- _useFirestoreRef ( docOrCollectionRef , {
109- target,
110- ...options ,
111- } )
112- ) !
107+ // allow usage of global injects in some composables
108+ const { promise, stop : _unbind } = app . runWithContext (
109+ ( ) =>
110+ scope . run ( ( ) =>
111+ _useFirestoreRef ( docOrCollectionRef , {
112+ target,
113+ ...options ,
114+ } )
115+ ) !
116+ )
113117
114118 // override the unbind to also free th variables created
115119 const unbind : UnbindWithReset = ( reset ) => {
You can’t perform that action at this time.
0 commit comments