Skip to content

Commit 0e2de18

Browse files
committed
Add try blocks to ble and remove debug message
1 parent 19a2fbb commit 0e2de18

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

js/layout.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ function refitTerminal() {
139139
if (xterm_screen) {
140140
let cols = Math.floor(terminalWidth / TERMINAL_COL_WIDTH);
141141
let rows = Math.floor(terminalHeight / TERMINAL_ROW_HEIGHT);
142-
console.log(rows, cols, terminalHeight, terminalWidth, TERMINAL_ROW_HEIGHT, TERMINAL_COL_WIDTH);
143142
if (cols < MINIMUM_COLS) {
144143
cols = MINIMUM_COLS;
145144
}

js/workflows/ble.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,14 @@ class BLEWorkflow extends Workflow {
253253
}
254254
// Is this a new connection?
255255
if (!this.bleDevice) {
256-
let devices = await navigator.bluetooth.getDevices();
257-
for (const device of devices) {
258-
await this.connectToBluetoothDevice(device);
256+
try {
257+
let devices = await navigator.bluetooth.getDevices();
258+
for (const device of devices) {
259+
await this.connectToBluetoothDevice(device);
260+
}
261+
} catch (error) {
262+
console.error(error);
263+
this.showConnectStatus(this._suggestBLEConnectActions(error));
259264
}
260265
}
261266
}

0 commit comments

Comments
 (0)