Skip to content

Commit 4ec8897

Browse files
committed
Fix save and reboot closing UX
1 parent e8d8a61 commit 4ec8897

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/js/serial_backend.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ export function initializeSerialBackend() {
6161

6262
EventBus.$on("port-handler:auto-select-serial-device", function () {
6363
if (
64-
!GUI.connected_to &&
65-
!GUI.connecting_to &&
66-
!["cli", "firmware_flasher"].includes(GUI.active_tab) &&
67-
PortHandler.portPicker.autoConnect &&
68-
!isCliOnlyMode() &&
69-
(connectionTimestamp === null || connectionTimestamp > 0) ||
70-
(Date.now() - rebootTimestamp <= REBOOT_CONNECT_MAX_TIME_MS)
64+
(!GUI.connected_to &&
65+
!GUI.connecting_to &&
66+
!["cli", "firmware_flasher"].includes(GUI.active_tab) &&
67+
PortHandler.portPicker.autoConnect &&
68+
!isCliOnlyMode() &&
69+
(connectionTimestamp === null || connectionTimestamp > 0)) ||
70+
Date.now() - rebootTimestamp <= REBOOT_CONNECT_MAX_TIME_MS
7171
) {
7272
connectDisconnect();
7373
}
@@ -808,12 +808,10 @@ export function reinitializeConnection() {
808808
// Send reboot command to the flight controller
809809
MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false);
810810

811-
if (currentPort.startsWith("bluetooth")) {
812-
if (!PortHandler.portPicker.autoConnect) {
813-
return setTimeout(function () {
814-
$("a.connection_button__link").trigger("click");
815-
}, 1500);
816-
}
811+
if (currentPort.startsWith("bluetooth") || currentPort === "manual") {
812+
return setTimeout(function () {
813+
$("a.connection_button__link").trigger("click");
814+
}, 1500);
817815
}
818816

819817
// Show reboot progress modal except for cli and presets tab

0 commit comments

Comments
 (0)