File tree Expand file tree Collapse file tree 1 file changed +10
-17
lines changed Expand file tree Collapse file tree 1 file changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -89,22 +89,13 @@ export const firestorePlugin = function firestorePlugin(
89
89
) {
90
90
const options = Object . assign ( { } , globalOptions , userOptions )
91
91
const target = toRef ( this . $data as any , key )
92
- let unbinds = firestoreUnbinds . get ( this )
93
-
94
- if ( unbinds ) {
95
- if ( unbinds [ key ] ) {
96
- unbinds [ key ] (
97
- // if wait, allow overriding with a function or reset, otherwise, force reset to false
98
- // else pass the reset option
99
- options . wait
100
- ? typeof options . reset === 'function'
101
- ? options . reset
102
- : false
103
- : options . reset
104
- )
105
- }
106
- } else {
107
- firestoreUnbinds . set ( this , ( unbinds = { } ) )
92
+ if ( ! firestoreUnbinds . has ( this ) ) {
93
+ firestoreUnbinds . set ( this , { } )
94
+ }
95
+ const unbinds = firestoreUnbinds . get ( this ) !
96
+
97
+ if ( unbinds [ key ] ) {
98
+ unbinds [ key ] ( options . reset )
108
99
}
109
100
110
101
const { promise, unbind } = _useFirestoreRef ( docOrCollectionRef , {
@@ -113,7 +104,9 @@ export const firestorePlugin = function firestorePlugin(
113
104
} )
114
105
unbinds [ key ] = unbind
115
106
// @ts -expect-error: we are allowed to write it
116
- this . $firestoreRefs [ key ] = docOrCollectionRef
107
+ this . $firestoreRefs [ key ] =
108
+ // ts
109
+ docOrCollectionRef
117
110
return promise . value
118
111
}
119
112
You can’t perform that action at this time.
0 commit comments