@@ -565,7 +565,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
565565 const patterns = await this . getWatcherPatterns ( liveSyncData , projectData , platforms ) ;
566566
567567 if ( liveSyncData . useHotModuleReload ) {
568- this . $hmrStatusService . attachToHrmStatusEvent ( ) ;
568+ this . $hmrStatusService . attachToHmrStatusEvent ( ) ;
569569 }
570570
571571 if ( liveSyncData . watchAllFiles ) {
@@ -586,10 +586,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
586586 }
587587
588588 let filesToSync : string [ ] = [ ] ;
589- const hmrData : { hash : string ; fallbackFiles : IDictionary < string [ ] > } = {
590- hash : "" ,
591- fallbackFiles : { }
592- } ;
589+ const hmrData : IDictionary < IPlatformHmrData > = { } ;
593590 const filesToSyncMap : IDictionary < string [ ] > = { } ;
594591 let filesToRemove : string [ ] = [ ] ;
595592 let timeoutTimer : NodeJS . Timer ;
@@ -635,6 +632,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
635632 await this . $devicesService . execute ( async ( device : Mobile . IDevice ) => {
636633 const liveSyncProcessInfo = this . liveSyncProcessesInfo [ projectData . projectDir ] ;
637634 const deviceBuildInfoDescriptor = _ . find ( liveSyncProcessInfo . deviceDescriptors , dd => dd . identifier === device . deviceInfo . identifier ) ;
635+ const platformHmrData = ( currentHmrData && currentHmrData [ device . deviceInfo . platform ] ) || < any > { } ;
638636
639637 const settings : ILiveSyncWatchInfo = {
640638 liveSyncDeviceInfo : deviceBuildInfoDescriptor ,
@@ -643,7 +641,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
643641 filesToSync : currentFilesToSync ,
644642 isReinstalled : false ,
645643 syncAllFiles : liveSyncData . watchAllFiles ,
646- hmrData : currentHmrData ,
644+ hmrData : platformHmrData ,
647645 useHotModuleReload : liveSyncData . useHotModuleReload ,
648646 force : liveSyncData . force ,
649647 connectTimeout : 1000
@@ -657,10 +655,10 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
657655 await this . refreshApplication ( projectData , liveSyncResultInfo , deviceBuildInfoDescriptor . debugOptions , deviceBuildInfoDescriptor . outputPath ) ;
658656
659657 // If didRecover is true, this means we were in ErrorActivity and fallback files were already transfered and app will be restarted.
660- if ( ! liveSyncResultInfo . didRecover && liveSyncData . useHotModuleReload && currentHmrData . hash ) {
661- const status = await this . $hmrStatusService . getHmrStatus ( device . deviceInfo . identifier , currentHmrData . hash ) ;
658+ if ( ! liveSyncResultInfo . didRecover && liveSyncData . useHotModuleReload && platformHmrData . hash ) {
659+ const status = await this . $hmrStatusService . getHmrStatus ( device . deviceInfo . identifier , platformHmrData . hash ) ;
662660 if ( status === HmrConstants . HMR_ERROR_STATUS ) {
663- watchInfo . filesToSync = currentHmrData . fallbackFiles [ device . deviceInfo . platform ] ;
661+ watchInfo . filesToSync = platformHmrData . fallbackFiles ;
664662 liveSyncResultInfo = await service . liveSyncWatchAction ( device , watchInfo ) ;
665663 // We want to force a restart of the application.
666664 liveSyncResultInfo . isFullSync = true ;
@@ -703,8 +701,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
703701 settings . connectTimeout = null ;
704702
705703 if ( liveSyncData . useHotModuleReload && appInstalledOnDeviceResult . appInstalled ) {
706- const additionalFilesToSync = currentHmrData && currentHmrData . fallbackFiles && currentHmrData . fallbackFiles [ device . deviceInfo . platform ] ;
707- _ . each ( additionalFilesToSync , fileToSync => currentFilesToSync . push ( fileToSync ) ) ;
704+ _ . each ( platformHmrData . fallbackFiles , fileToSync => currentFilesToSync . push ( fileToSync ) ) ;
708705 }
709706
710707 await watchAction ( settings ) ;
0 commit comments