Skip to content

Commit 9953dca

Browse files
chore: set the useHotModuleReload in the result of the liveSync
Set the result of the `useHotModuleReload` in the result of the LiveSync operation, so the code that decides if app should be restarted will have access to the passed value.
1 parent 6489e15 commit 9953dca

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

lib/services/livesync/device-livesync-service-base.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ export abstract class DeviceLiveSyncServiceBase {
99
protected device: Mobile.IDevice
1010
) { }
1111

12-
public canExecuteFastSync(liveSyncData: ILiveSyncResultInfo, filePath: string, projectData: IProjectData, platform: string): boolean {
12+
public canExecuteFastSync(liveSyncResult: ILiveSyncResultInfo, filePath: string, projectData: IProjectData, platform: string): boolean {
1313
const fastSyncFileExtensions = this.getFastLiveSyncFileExtensions(platform, projectData);
14-
return liveSyncData.useHotModuleReload || _.includes(fastSyncFileExtensions, path.extname(filePath));
14+
return liveSyncResult.useHotModuleReload || _.includes(fastSyncFileExtensions, path.extname(filePath));
1515
}
1616

17-
protected canExecuteFastSyncForPaths(liveSyncData:ILiveSyncResultInfo, localToDevicePaths: Mobile.ILocalToDevicePathData[], projectData: IProjectData, platform: string) {
17+
protected canExecuteFastSyncForPaths(liveSyncResult: ILiveSyncResultInfo, localToDevicePaths: Mobile.ILocalToDevicePathData[], projectData: IProjectData, platform: string) {
1818
return !_.some(localToDevicePaths,
1919
(localToDevicePath: Mobile.ILocalToDevicePathData) =>
20-
!this.canExecuteFastSync(liveSyncData, localToDevicePath.getLocalPath(), projectData, this.device.deviceInfo.platform));
20+
!this.canExecuteFastSync(liveSyncResult, localToDevicePath.getLocalPath(), projectData, this.device.deviceInfo.platform));
2121
}
2222

2323
@cache()
@@ -42,7 +42,7 @@ export abstract class DeviceLiveSyncServiceBase {
4242
public async finalizeSync(liveSyncInfo: ILiveSyncResultInfo, projectData: IProjectData): Promise<IAndroidLivesyncSyncOperationResult> {
4343
//implement in case a sync point for all remove/create operation is needed
4444
return {
45-
didRefresh:true,
45+
didRefresh: true,
4646
operationId: ""
4747
};
4848
}

lib/services/livesync/ios-livesync-service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ export class IOSLiveSyncService extends PlatformLiveSyncServiceBase implements I
5252
return {
5353
deviceAppData,
5454
isFullSync: true,
55-
modifiedFilesData: []
55+
modifiedFilesData: [],
56+
useHotModuleReload: syncInfo.useHotModuleReload
5657
};
5758
}
5859

lib/services/livesync/platform-livesync-service-base.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ export abstract class PlatformLiveSyncServiceBase {
5252
return {
5353
modifiedFilesData,
5454
isFullSync: true,
55-
deviceAppData
55+
deviceAppData,
56+
useHotModuleReload: syncInfo.useHotModuleReload
5657
};
5758
}
5859

@@ -107,7 +108,8 @@ export abstract class PlatformLiveSyncServiceBase {
107108
return {
108109
modifiedFilesData: modifiedLocalToDevicePaths,
109110
isFullSync: liveSyncInfo.isReinstalled,
110-
deviceAppData
111+
deviceAppData,
112+
useHotModuleReload: liveSyncInfo.useHotModuleReload
111113
};
112114
}
113115

0 commit comments

Comments
 (0)