File tree Expand file tree Collapse file tree 1 file changed +21
-11
lines changed
packages/node_modules/overmind/src Expand file tree Collapse file tree 1 file changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -307,8 +307,13 @@ export class Overmind<ThisConfig extends IConfiguration>
307307 }
308308
309309 if ( process . env . NODE_ENV === 'production' && mode . mode === MODE_DEFAULT ) {
310- eventHub . on ( EventType . OPERATOR_ASYNC , ( ) => {
311- proxyStateTree . getMutationTree ( ) . flush ( true )
310+ eventHub . on ( EventType . OPERATOR_ASYNC , ( execution ) => {
311+ if (
312+ ! execution . parentExecution ||
313+ ! execution . parentExecution . isRunning
314+ ) {
315+ proxyStateTree . getMutationTree ( ) . flush ( true )
316+ }
312317 } )
313318 eventHub . on ( EventType . ACTION_END , ( execution ) => {
314319 if ( ! execution . parentExecution || ! execution . parentExecution . isRunning )
@@ -331,15 +336,20 @@ export class Overmind<ThisConfig extends IConfiguration>
331336 } )
332337 }
333338 eventHub . on ( EventType . OPERATOR_ASYNC , ( execution ) => {
334- const flushData = execution . flush ( true )
335- if ( this . devtools && flushData . mutations . length ) {
336- this . devtools . send ( {
337- type : 'flush' ,
338- data : {
339- ...execution ,
340- ...flushData ,
341- } ,
342- } )
339+ if (
340+ ! execution . parentExecution ||
341+ ! execution . parentExecution . isRunning
342+ ) {
343+ const flushData = execution . flush ( true )
344+ if ( this . devtools && flushData . mutations . length ) {
345+ this . devtools . send ( {
346+ type : 'flush' ,
347+ data : {
348+ ...execution ,
349+ ...flushData ,
350+ } ,
351+ } )
352+ }
343353 }
344354 } )
345355 eventHub . on ( EventType . ACTION_END , ( execution ) => {
You can’t perform that action at this time.
0 commit comments