Skip to content

Commit 82de7a6

Browse files
committed
chore: fix PR comments
1 parent 2cb69c9 commit 82de7a6

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

lib/definitions/preview-app-livesync.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ declare global {
1818
}
1919

2020
interface IPreviewAppPluginsService {
21-
getDeviceWarnings(device: Device): string[];
21+
getPluginsUsageWarnings(data: IPreviewAppLiveSyncData, device: Device): string[];
2222
comparePluginsOnDevice(data: IPreviewAppLiveSyncData, device: Device): Promise<void>;
2323
getExternalPlugins(device: Device): string[];
2424
}
@@ -46,5 +46,6 @@ declare global {
4646
updateConnectedDevices(devices: Device[]): void;
4747
getDeviceById(id: string): Device;
4848
getDevicesForPlatform(platform: string): Device[];
49+
getPluginsUsageWarnings(data: IPreviewAppLiveSyncData, device: Device): string[];
4950
}
5051
}

lib/services/livesync/playground/devices/preview-devices-service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export class PreviewDevicesService extends EventEmitter implements IPreviewDevic
3131
return _.filter(this.connectedDevices, { platform: platform.toLowerCase() });
3232
}
3333

34-
public getDeviceWarnings(device: Device): string[] {
35-
return this.$previewAppPluginsService.getDeviceWarnings(device);
34+
public getPluginsUsageWarnings(data: IPreviewAppLiveSyncData, device: Device): string[] {
35+
return this.$previewAppPluginsService.getPluginsUsageWarnings(data, device);
3636
}
3737

3838
private raiseDeviceFound(device: Device) {

lib/services/livesync/playground/preview-app-plugins-service.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class PreviewAppPluginsService implements IPreviewAppPluginsService {
1414
private $logger: ILogger,
1515
private $pluginsService: IPluginsService) { }
1616

17-
public getDeviceWarnings(device: Device): string[] {
17+
public getPluginsUsageWarnings(data: IPreviewAppLiveSyncData, device: Device): string[] {
1818
if (!device) {
1919
this.$errors.failWithoutHelp("No device provided.");
2020
}
@@ -23,10 +23,6 @@ export class PreviewAppPluginsService implements IPreviewAppPluginsService {
2323
this.$errors.failWithoutHelp("No version of preview app provided.");
2424
}
2525

26-
return this.previewAppVersionWarnings[device.previewAppVersion];
27-
}
28-
29-
public async comparePluginsOnDevice(data: IPreviewAppLiveSyncData, device: Device): Promise<void> {
3026
if (!this.previewAppVersionWarnings[device.previewAppVersion]) {
3127
const devicePlugins = this.getDevicePlugins(device);
3228
const localPlugins = this.getLocalPlugins(data.projectDir);
@@ -40,7 +36,12 @@ export class PreviewAppPluginsService implements IPreviewAppPluginsService {
4036
this.previewAppVersionWarnings[device.previewAppVersion] = warnings;
4137
}
4238

43-
this.previewAppVersionWarnings[device.previewAppVersion].map(warning => this.$logger.warn(warning));
39+
return this.previewAppVersionWarnings[device.previewAppVersion];
40+
}
41+
42+
public async comparePluginsOnDevice(data: IPreviewAppLiveSyncData, device: Device): Promise<void> {
43+
const warnings = this.getPluginsUsageWarnings(data, device);
44+
_.map(warnings, warning => this.$logger.warn(warning));
4445
}
4546

4647
public getExternalPlugins(device: Device): string[] {

0 commit comments

Comments
 (0)