Skip to content

Commit f0c6bcb

Browse files
committed
Fix repeated logging when device null
1 parent 130e704 commit f0c6bcb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/js/port_handler.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ PortHandler.removedSerialDevice = function (device) {
122122
PortHandler.addedUsbDevice = function (device) {
123123
this.updateDeviceList("usb").then(() => {
124124
const selectedPort = this.selectActivePort(device);
125-
if (selectedPort === device?.path) {
126-
// Send event when the port handler auto selects a new USB 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
127128
EventBus.$emit("port-handler:auto-select-usb-device", selectedPort);
128129
}
129130
});

0 commit comments

Comments
 (0)