File tree 1 file changed +21
-1
lines changed
packages/app-backend-core/src
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ export function installHook (target, isIframe = false) {
66
66
try {
67
67
const hook = ( window . parent as any ) . __VUE_DEVTOOLS_GLOBAL_HOOK__
68
68
if ( hook ) {
69
- cb ( hook )
69
+ return cb ( hook )
70
70
} else {
71
71
console . warn ( '[Vue Devtools] No hook in parent window' )
72
72
}
@@ -102,6 +102,10 @@ export function installHook (target, isIframe = false) {
102
102
emit ( event , ...args ) {
103
103
sendToParent ( hook => hook . emit ( event , ...args ) )
104
104
} ,
105
+
106
+ cleanupBuffer ( matchArg ) {
107
+ return sendToParent ( hook => hook . cleanupBuffer ( matchArg ) ) ?? false
108
+ } ,
105
109
}
106
110
} else {
107
111
hook = {
@@ -191,6 +195,22 @@ export function installHook (target, isIframe = false) {
191
195
this . _buffer . push ( [ event , ...args ] )
192
196
}
193
197
} ,
198
+
199
+ /**
200
+ * Remove buffered events with any argument that is equal to the given value.
201
+ * @param matchArg Given value to match.
202
+ */
203
+ cleanupBuffer ( matchArg ) {
204
+ let wasBuffered = false
205
+ this . _buffer = this . _buffer . filter ( item => {
206
+ if ( item . some ( arg => arg === matchArg ) ) {
207
+ wasBuffered = true
208
+ return false
209
+ }
210
+ return true
211
+ } )
212
+ return wasBuffered
213
+ } ,
194
214
}
195
215
196
216
hook . once ( 'init' , Vue => {
You can’t perform that action at this time.
0 commit comments