Skip to content

Commit 04abcb8

Browse files
committed
Fix messages
Fix "cannot read property .toLowerCase of undefined" error
1 parent 7473b78 commit 04abcb8

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

lib/commands/run.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ export class RunCommandBase implements ICommand {
3030
}
3131

3232
const validatePlatformOutput = await this.$liveSyncCommandHelper.validatePlatform(this.platform);
33-
if (validatePlatformOutput && validatePlatformOutput[this.platform.toLowerCase()]) {
33+
34+
if (this.platform && validatePlatformOutput && validatePlatformOutput[this.platform.toLowerCase()]) {
3435
const checkEnvironmentRequirementsOutput = validatePlatformOutput[this.platform.toLowerCase()].checkEnvironmentRequirementsOutput;
3536
this.liveSyncCommandHelperAdditionalOptions.syncToPreviewApp = checkEnvironmentRequirementsOutput && checkEnvironmentRequirementsOutput.selectedOption === "Sync to Playground";
3637
}

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@ export class PreviewSdkService extends EventEmitter implements IPreviewSdkServic
5353
private getCallbacks(): SdkCallbacks {
5454
return {
5555
onLogSdkMessage: (log: string) => {
56-
this.$logger.trace("onLogSdkMessage!!!", log);
56+
this.$logger.trace("Received onLogSdkMessage message: ", log);
5757
},
5858
onConnectedDevicesChange: (connectedDevices: ConnectedDevices) => ({ }),
5959
onLogMessage: (log: string, deviceName: string) => {
6060
this.$logger.info(`LOG from device ${deviceName}: ${log}`);
6161
},
6262
onRestartMessage: () => {
63-
console.log("ON RESTART MESSAGE!!!");
63+
this.$logger.trace("Received onRestartMessage event.");
6464
},
6565
onUncaughtErrorMessage: () => {
66-
this.$errors.failWithoutHelp("UncaughtErrorMessage while preview app!!");
66+
this.$errors.failWithoutHelp("Error while communicating with preview app.");
6767
},
6868
onDeviceConnectedMessage: (deviceConnectedMessage: DeviceConnectedMessage) => ({ }),
6969
onDeviceConnected: (device: Device) => {

lib/services/qr-code-terminal-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class QrCodeTerminalService implements IQrCodeTerminalService {
99
try {
1010
qrcode.generate(url);
1111
} catch (err) {
12-
this.$logger.trace(`Failed to generate QR code for ${url}`, err);
12+
this.$logger.info(`Failed to generate QR code for ${url}`, err);
1313
}
1414
}
1515
}

0 commit comments

Comments
 (0)