@@ -666,6 +666,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
666
666
filesToSync : currentFilesToSync ,
667
667
isReinstalled : appInstalledOnDeviceResult . appInstalled ,
668
668
syncAllFiles : liveSyncData . watchAllFiles ,
669
+ hmrData : currentHmrData ,
669
670
useHotModuleReload : liveSyncData . useHotModuleReload ,
670
671
force : liveSyncData . force
671
672
} ;
@@ -674,11 +675,13 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
674
675
675
676
await this . refreshApplication ( projectData , liveSyncResultInfo , deviceBuildInfoDescriptor . debugOptions , deviceBuildInfoDescriptor . outputPath ) ;
676
677
677
- if ( liveSyncData . useHotModuleReload && currentHmrData . hash ) {
678
+ //If didRecover is true, this means we were in ErrorActivity and fallback files were already transfered and app will be restarted.
679
+ if ( ! liveSyncResultInfo . didRecover && liveSyncData . useHotModuleReload && currentHmrData . hash ) {
678
680
const status = await this . $hmrStatusService . getHmrStatus ( device . deviceInfo . identifier , currentHmrData . hash ) ;
679
681
if ( status === HmrConstants . HMR_ERROR_STATUS ) {
680
682
settings . filesToSync = currentHmrData . fallbackFiles [ device . deviceInfo . platform ] ;
681
683
liveSyncResultInfo = await service . liveSyncWatchAction ( device , settings ) ;
684
+ //We want to force a restart of the application.
682
685
liveSyncResultInfo . isFullSync = true ;
683
686
await this . refreshApplication ( projectData , liveSyncResultInfo , deviceBuildInfoDescriptor . debugOptions , deviceBuildInfoDescriptor . outputPath ) ;
684
687
}
0 commit comments