diff --git a/locales/en/messages.json b/locales/en/messages.json index af923fdb30..a956439b53 100755 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -55,6 +55,9 @@ "portsSelectManual": { "message": "Manual Selection" }, + "portsSelectNone": { + "message": "No connection available" + }, "portsSelectVirtual": { "message": "Virtual Mode (Experimental)", "description": "Configure a Virtual Flight Controller without the need of a physical FC." diff --git a/src/js/port_handler.js b/src/js/port_handler.js index 29b51eefa3..80b3670954 100644 --- a/src/js/port_handler.js +++ b/src/js/port_handler.js @@ -108,8 +108,8 @@ PortHandler.check_serial_devices = function () { // auto-select port (only during initialization) if (!self.initialPorts) { - self.currentPorts = self.updatePortSelect(self.currentPorts); - self.selectPort(self.currentPorts); + self.updatePortSelect(self.currentPorts); + self.selectActivePort(); self.initialPorts = self.currentPorts; GUI.updateManualPortVisibility(); } else { @@ -121,64 +121,43 @@ PortHandler.check_serial_devices = function () { PortHandler.check_usb_devices = function (callback) { const self = this; - const portSelect = document.querySelector('#port'); chrome.usb.getDevices(usbDevices, function (result) { - const dfuActive = !!portSelect.value.startsWith('DFU'); + const dfuElement = self.portPickerElement.children("[value='DFU']"); if (result.length) { // Found device in DFU mode, add it to the list - if (!dfuActive) { - self.clearOptions(); - - // self.portPickerElement.append($('