Skip to content

Commit ff9468a

Browse files
committed
Fix reboot condition
1 parent cb9d82f commit ff9468a

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
}
@@ -811,9 +812,9 @@ export function reinitializeConnection() {
811812
}
812813
}
813814

814-
// Show reboot progress modal except for presets tab
815-
if (GUI.active_tab === "presets") {
816-
console.log("Rebooting in presets tab, skipping reboot dialog", GUI.active_tab);
815+
// Show reboot progress modal except for cli and presets tab
816+
if (["cli", "presets"].includes(GUI.active_tab)) {
817+
console.log(`${logHead} Rebooting in ${GUI.active_tab} tab, skipping reboot dialog`);
817818
gui_log(i18n.getMessage("deviceRebooting"));
818819
gui_log(i18n.getMessage("deviceReady"));
819820

0 commit comments

Comments
 (0)