Skip to content

Commit dca2b77

Browse files
committed
Pleasing sonar
1 parent 605efae commit dca2b77

File tree

3 files changed

+4
-119
lines changed

3 files changed

+4
-119
lines changed

src/js/port_handler.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,8 @@ PortHandler.removedSerialDevice = function (device) {
122122
PortHandler.addedUsbDevice = function (device) {
123123
this.updateDeviceList("usb").then(() => {
124124
const selectedPort = this.selectActivePort(device);
125-
console.log(`${this.logHead} Added USB device:`, device, selectedPort);
126-
if (selectedPort === device.path) {
127-
// Emit an event with the proper type for backward compatibility
125+
if (selectedPort === device?.path) {
126+
// Send event when the port handler auto selects a new USB device
128127
EventBus.$emit("port-handler:auto-select-usb-device", selectedPort);
129128
}
130129
});

src/js/protocols/__tests__/WebBluetooth.test.js

-114
This file was deleted.

src/js/serial_backend.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function initializeSerialBackend() {
6161
!GUI.connecting_to &&
6262
GUI.active_tab !== "firmware_flasher" &&
6363
((PortHandler.portPicker.autoConnect && !["manual", "virtual"].includes(device)) ||
64-
Date.now() - rebootTimestamp > REBOOT_CONNECT_MAX_TIME_MS)
64+
Date.now() - rebootTimestamp < REBOOT_CONNECT_MAX_TIME_MS)
6565
) {
6666
connectDisconnect();
6767
}
@@ -73,7 +73,7 @@ export function initializeSerialBackend() {
7373
!GUI.connecting_to &&
7474
GUI.active_tab !== "firmware_flasher" &&
7575
((PortHandler.portPicker.autoConnect && !["manual", "virtual"].includes(device)) ||
76-
Date.now() - rebootTimestamp > REBOOT_CONNECT_MAX_TIME_MS)
76+
Date.now() - rebootTimestamp < REBOOT_CONNECT_MAX_TIME_MS)
7777
) {
7878
connectDisconnect();
7979
}

0 commit comments

Comments
 (0)