Skip to content

Commit ba73741

Browse files
author
Tsvetan Raikov
committed
Merge branch 'raikov/fix-livesync' into raikov/fix-firsttime-livesync
2 parents 792d7a5 + 89ff505 commit ba73741

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ class AndroidLiveSyncService extends liveSyncServiceBaseLib.LiveSyncServiceBase<
7373

7474
public afterInstallApplicationAction(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture<boolean> {
7575
return (() => {
76-
this.deviceHashService.uploadHashFileToDevice(localToDevicePaths).wait();
77-
return false;
76+
this.deviceHashService.uploadHashFileToDevice(localToDevicePaths).wait();
77+
return false;
7878
}).future<boolean>()();
7979
}
8080

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ class IOSLiveSyncService extends liveSyncServiceBaseLib.LiveSyncServiceBase<Mobi
2020
}
2121

2222
public afterInstallApplicationAction(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture<boolean> {
23-
return (() => {
24-
return this.$options.watch;
25-
}).future<boolean>()();
26-
}
27-
23+
return (() => {
24+
return this.$options.watch;
25+
}).future<boolean>()();
26+
}
27+
2828
public removeFiles(appIdentifier: string, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture<void> {
2929
return (() => {
3030
_.each(localToDevicePaths, localToDevicePathData => this.device.fileSystem.deleteFile(localToDevicePathData.getDevicePath(), appIdentifier));

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

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@ export abstract class LiveSyncServiceBase<T extends Mobile.IDevice> {
77
private $liveSyncProvider: ILiveSyncProvider) { }
88

99
public refreshApplication(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[], forceExecuteFullSync: boolean): IFuture<void> {
10-
let canExecuteFastSync = !forceExecuteFullSync && localToDevicePaths &&
11-
_.each(localToDevicePaths, localToDevicePath => this.$liveSyncProvider.canExecuteFastSync(localToDevicePath.getLocalPath(), deviceAppData.platform));
10+
let canExecuteFastSync = !forceExecuteFullSync && localToDevicePaths !== undefined;
11+
for (let localToDevicePath of localToDevicePaths) {
12+
if (!this.$liveSyncProvider.canExecuteFastSync(localToDevicePath.getLocalPath(), deviceAppData.platform)) {
13+
canExecuteFastSync = false;
14+
break;
15+
}
16+
}
1217
if (canExecuteFastSync) {
1318
return this.reloadPage(deviceAppData);
1419
}

0 commit comments

Comments
 (0)