Skip to content

Commit 902a5b4

Browse files
committed
Fix reboot condition
1 parent 7cd518e commit 902a5b4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/js/serial_backend.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ export function initializeSerialBackend() {
5959
if (
6060
!GUI.connected_to &&
6161
!GUI.connecting_to &&
62-
GUI.active_tab !== "firmware_flasher" &&
63-
(PortHandler.portPicker.autoConnect || Date.now() - rebootTimestamp < REBOOT_CONNECT_MAX_TIME_MS)
62+
!["cli", "firmware_flasher"].includes(GUI.active_tab) &&
63+
PortHandler.portPicker.autoConnect &&
64+
!(Date.now() - rebootTimestamp > REBOOT_CONNECT_MAX_TIME_MS)
6465
) {
6566
connectDisconnect();
6667
}
@@ -805,9 +806,9 @@ export function reinitializeConnection() {
805806
}
806807
}
807808

808-
// Show reboot progress modal except for presets tab
809-
if (GUI.active_tab === "presets") {
810-
console.log("Rebooting in presets tab, skipping reboot dialog", GUI.active_tab);
809+
// Show reboot progress modal except for cli and presets tab
810+
if (["cli", "presets"].includes(GUI.active_tab)) {
811+
console.log(`${logHead} Rebooting in ${GUI.active_tab} tab, skipping reboot dialog`);
811812
gui_log(i18n.getMessage("deviceRebooting"));
812813
gui_log(i18n.getMessage("deviceReady"));
813814

0 commit comments

Comments
 (0)