@@ -565,7 +565,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
565
565
const patterns = await this . getWatcherPatterns ( liveSyncData , projectData , platforms ) ;
566
566
567
567
if ( liveSyncData . useHotModuleReload ) {
568
- this . $hmrStatusService . attachToHrmStatusEvent ( ) ;
568
+ this . $hmrStatusService . attachToHmrStatusEvent ( ) ;
569
569
}
570
570
571
571
if ( liveSyncData . watchAllFiles ) {
@@ -586,10 +586,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
586
586
}
587
587
588
588
let filesToSync : string [ ] = [ ] ;
589
- const hmrData : { hash : string ; fallbackFiles : IDictionary < string [ ] > } = {
590
- hash : "" ,
591
- fallbackFiles : { }
592
- } ;
589
+ const hmrData : IDictionary < IPlatformHmrData > = { } ;
593
590
const filesToSyncMap : IDictionary < string [ ] > = { } ;
594
591
let filesToRemove : string [ ] = [ ] ;
595
592
let timeoutTimer : NodeJS . Timer ;
@@ -635,6 +632,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
635
632
await this . $devicesService . execute ( async ( device : Mobile . IDevice ) => {
636
633
const liveSyncProcessInfo = this . liveSyncProcessesInfo [ projectData . projectDir ] ;
637
634
const deviceBuildInfoDescriptor = _ . find ( liveSyncProcessInfo . deviceDescriptors , dd => dd . identifier === device . deviceInfo . identifier ) ;
635
+ const platformHmrData = ( currentHmrData && currentHmrData [ device . deviceInfo . platform ] ) || < any > { } ;
638
636
639
637
const settings : ILiveSyncWatchInfo = {
640
638
liveSyncDeviceInfo : deviceBuildInfoDescriptor ,
@@ -643,7 +641,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
643
641
filesToSync : currentFilesToSync ,
644
642
isReinstalled : false ,
645
643
syncAllFiles : liveSyncData . watchAllFiles ,
646
- hmrData : currentHmrData ,
644
+ hmrData : platformHmrData ,
647
645
useHotModuleReload : liveSyncData . useHotModuleReload ,
648
646
force : liveSyncData . force ,
649
647
connectTimeout : 1000
@@ -657,10 +655,10 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
657
655
await this . refreshApplication ( projectData , liveSyncResultInfo , deviceBuildInfoDescriptor . debugOptions , deviceBuildInfoDescriptor . outputPath ) ;
658
656
659
657
// 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 ) ;
662
660
if ( status === HmrConstants . HMR_ERROR_STATUS ) {
663
- watchInfo . filesToSync = currentHmrData . fallbackFiles [ device . deviceInfo . platform ] ;
661
+ watchInfo . filesToSync = platformHmrData . fallbackFiles ;
664
662
liveSyncResultInfo = await service . liveSyncWatchAction ( device , watchInfo ) ;
665
663
// We want to force a restart of the application.
666
664
liveSyncResultInfo . isFullSync = true ;
@@ -703,8 +701,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
703
701
settings . connectTimeout = null ;
704
702
705
703
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 ) ) ;
708
705
}
709
706
710
707
await watchAction ( settings ) ;
0 commit comments