@@ -51,7 +51,7 @@ export class RunController extends EventEmitter implements IRunController {
5151 }
5252
5353 if ( ! this . prepareReadyEventHandler ) {
54- this . prepareReadyEventHandler = async ( data : IFilesChangeEventData ) => {
54+ const handler = async ( data : IFilesChangeEventData ) => {
5555 if ( data . hasNativeChanges ) {
5656 const platformData = this . $platformsDataService . getPlatformData ( data . platform , projectData ) ;
5757 const prepareData = this . $prepareDataService . getPrepareData ( liveSyncInfo . projectDir , data . platform , { ...liveSyncInfo , watch : ! liveSyncInfo . skipWatcher } ) ;
@@ -63,7 +63,9 @@ export class RunController extends EventEmitter implements IRunController {
6363 await this . syncChangedDataOnDevices ( data , projectData , liveSyncInfo ) ;
6464 }
6565 } ;
66- this . $prepareController . on ( PREPARE_READY_EVENT_NAME , this . prepareReadyEventHandler . bind ( this ) ) ;
66+
67+ this . prepareReadyEventHandler = handler . bind ( this ) ;
68+ this . $prepareController . on ( PREPARE_READY_EVENT_NAME , this . prepareReadyEventHandler ) ;
6769 }
6870
6971 await this . syncInitialDataOnDevices ( projectData , liveSyncInfo , deviceDescriptorsForInitialSync ) ;
@@ -113,7 +115,7 @@ export class RunController extends EventEmitter implements IRunController {
113115 liveSyncProcessInfo . deviceDescriptors = [ ] ;
114116
115117 if ( this . prepareReadyEventHandler ) {
116- this . removeListener ( PREPARE_READY_EVENT_NAME , this . prepareReadyEventHandler ) ;
118+ this . $prepareController . removeListener ( PREPARE_READY_EVENT_NAME , this . prepareReadyEventHandler ) ;
117119 this . prepareReadyEventHandler = null ;
118120 }
119121
@@ -377,7 +379,7 @@ export class RunController extends EventEmitter implements IRunController {
377379
378380 await this . $deviceInstallAppService . installOnDevice ( device , deviceDescriptor . buildData , rebuiltInformation [ platformData . platformNameLowerCase ] . packageFilePath ) ;
379381 await platformLiveSyncService . syncAfterInstall ( device , watchInfo ) ;
380- await platformLiveSyncService . restartApplication ( projectData , { deviceAppData, modifiedFilesData : [ ] , isFullSync : false , useHotModuleReload : liveSyncInfo . useHotModuleReload } ) ;
382+ await this . refreshApplication ( projectData , { deviceAppData, modifiedFilesData : [ ] , isFullSync : false , useHotModuleReload : liveSyncInfo . useHotModuleReload } , data , deviceDescriptor ) ;
381383 } else {
382384 const isInHMRMode = liveSyncInfo . useHotModuleReload && data . hmrData && data . hmrData . hash ;
383385 if ( isInHMRMode ) {
0 commit comments