Skip to content

Commit 8b82792

Browse files
authored
Fix autoconnect for plugins (#4674)
* Fix autoconnect for plugins * Intellisense messed up * Intellisense messed up and does not allow me to fix offline
1 parent 0cd3c4d commit 8b82792

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/js/serial_backend.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { ispConnected } from "./utils/connection";
3030
const logHead = "[SERIAL-BACKEND]";
3131

3232
let mspHelper;
33-
let connectionTimestamp;
33+
let connectionTimestamp = null;
3434
let liveDataRefreshTimerId = false;
3535

3636
let isConnected = false;
@@ -66,7 +66,8 @@ export function initializeSerialBackend() {
6666
!["cli", "firmware_flasher"].includes(GUI.active_tab) &&
6767
PortHandler.portPicker.autoConnect &&
6868
!isCliOnlyMode() &&
69-
Date.now() - rebootTimestamp <= REBOOT_CONNECT_MAX_TIME_MS
69+
(connectionTimestamp === null || connectionTimestamp > 0) ||
70+
(Date.now() - rebootTimestamp <= REBOOT_CONNECT_MAX_TIME_MS)
7071
) {
7172
connectDisconnect();
7273
}

0 commit comments

Comments
 (0)