@@ -335,11 +335,16 @@ class Manager extends Base {
335335 if ( action === 'updateVdom' ) {
336336 data . replyId = data . id ;
337337
338- me . promiseForwardMessage ( data ) . then ( msgData => {
339- me . sendMessage ( msgData . origin , { action : 'reply' , replyId : msgData . id , success : true } )
340- } ) ;
338+ if ( data . deltas ?. length > 0 ) {
339+ me . promiseForwardMessage ( data ) . then ( msgData => {
340+ me . sendMessage ( msgData . origin , { action : 'reply' , replyId : msgData . id , success : true } )
341+ } ) ;
342+
343+ me . fire ( 'updateVdom' , { data, replyId : data . id } )
344+ } else {
345+ me . sendMessage ( data . origin , { action : 'reply' , replyId : data . id , success : true } )
346+ }
341347
342- me . fire ( 'updateVdom' , { data, replyId : data . id } ) ;
343348 return
344349 }
345350
@@ -349,14 +354,18 @@ class Manager extends Base {
349354 if ( ! promise ) {
350355 if ( data . data ) {
351356 if ( data . data . autoMount || data . data . updateVdom ) {
352- // We want to delay the message until the rendering queue has processed it
353- // See: https://github.com/neomjs/neo/issues/2864
354- me . promiseForwardMessage ( data ) . then ( msgData => {
355- me . sendMessage ( msgData . destination , msgData )
356- } ) ;
357-
358- data . data . autoMount && me . fire ( 'automount' , data ) ;
359- data . data . updateVdom && me . fire ( 'updateVdom' , data )
357+ if ( data . data . updateVdom && ( ! data . data . deltas || data . data . deltas . length === 0 ) ) {
358+ me . sendMessage ( dest , data )
359+ } else {
360+ // We want to delay the message until the rendering queue has processed it
361+ // See: https://github.com/neomjs/neo/issues/2864
362+ me . promiseForwardMessage ( data ) . then ( msgData => {
363+ me . sendMessage ( msgData . destination , msgData )
364+ } ) ;
365+
366+ data . data . autoMount && me . fire ( 'automount' , data ) ;
367+ data . data . updateVdom && me . fire ( 'updateVdom' , data )
368+ }
360369 } else {
361370 me . sendMessage ( dest , data )
362371 }
0 commit comments