@@ -51,7 +51,7 @@ export class RunController extends EventEmitter implements IRunController {
51
51
}
52
52
53
53
if ( ! this . prepareReadyEventHandler ) {
54
- this . prepareReadyEventHandler = async ( data : IFilesChangeEventData ) => {
54
+ const handler = async ( data : IFilesChangeEventData ) => {
55
55
if ( data . hasNativeChanges ) {
56
56
const platformData = this . $platformsDataService . getPlatformData ( data . platform , projectData ) ;
57
57
const prepareData = this . $prepareDataService . getPrepareData ( liveSyncInfo . projectDir , data . platform , { ...liveSyncInfo , watch : ! liveSyncInfo . skipWatcher } ) ;
@@ -63,7 +63,9 @@ export class RunController extends EventEmitter implements IRunController {
63
63
await this . syncChangedDataOnDevices ( data , projectData , liveSyncInfo ) ;
64
64
}
65
65
} ;
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 ) ;
67
69
}
68
70
69
71
await this . syncInitialDataOnDevices ( projectData , liveSyncInfo , deviceDescriptorsForInitialSync ) ;
@@ -113,7 +115,7 @@ export class RunController extends EventEmitter implements IRunController {
113
115
liveSyncProcessInfo . deviceDescriptors = [ ] ;
114
116
115
117
if ( this . prepareReadyEventHandler ) {
116
- this . removeListener ( PREPARE_READY_EVENT_NAME , this . prepareReadyEventHandler ) ;
118
+ this . $prepareController . removeListener ( PREPARE_READY_EVENT_NAME , this . prepareReadyEventHandler ) ;
117
119
this . prepareReadyEventHandler = null ;
118
120
}
119
121
@@ -377,7 +379,7 @@ export class RunController extends EventEmitter implements IRunController {
377
379
378
380
await this . $deviceInstallAppService . installOnDevice ( device , deviceDescriptor . buildData , rebuiltInformation [ platformData . platformNameLowerCase ] . packageFilePath ) ;
379
381
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 ) ;
381
383
} else {
382
384
const isInHMRMode = liveSyncInfo . useHotModuleReload && data . hmrData && data . hmrData . hash ;
383
385
if ( isInHMRMode ) {
0 commit comments