diff --git a/src/js/port_handler.js b/src/js/port_handler.js index df3fe1dc..b204ebcc 100644 --- a/src/js/port_handler.js +++ b/src/js/port_handler.js @@ -23,6 +23,9 @@ PortHandler.initialize = function () { this.selectList = document.querySelector(portPickerElementSelector); this.initialWidth = this.selectList.offsetWidth + 12; + this.showVirtualMode = ConfigStorage.get('showVirtualMode').showVirtualMode; + this.showAllSerialDevices = ConfigStorage.get('showAllSerialDevices').showAllSerialDevices; + // fill dropdown with version numbers generateVirtualApiVersions(); @@ -32,17 +35,14 @@ PortHandler.initialize = function () { PortHandler.check = function () { const self = this; - let result; - result = ConfigStorage.get('showVirtualMode'); - self.showVirtualMode = result.showVirtualMode; - result = ConfigStorage.get('showAllSerialDevices'); - self.showAllSerialDevices = result.showAllSerialDevices; + if (!self.port_available) { + self.check_usb_devices(); + } - self.check_usb_devices(); - self.check_serial_devices(); - - GUI.updateManualPortVisibility(); + if (!self.dfu_available) { + self.check_serial_devices(); + } setTimeout(function () { self.check(); @@ -87,14 +87,6 @@ PortHandler.check_usb_devices = function (callback) { data: {isDFU: true}, })); - if (self.showVirtualMode) { - self.portPickerElement.append($('