Skip to content

Commit d69da50

Browse files
committed
Abort when already connected
1 parent 0c51874 commit d69da50

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/js/serial_backend.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ async function sendConfigTracking() {
9292
flightControllerIdentifier: FC.CONFIG.flightControllerIdentifier,
9393
mcu: FC.CONFIG.targetName,
9494
deviceIdentifier: CryptoES.SHA1(FC.CONFIG.deviceIdentifier).toString(),
95-
});
95+
});
9696
}
9797

9898
function connectDisconnect() {
@@ -330,6 +330,12 @@ function onOpen(openInfo) {
330330
}
331331
});
332332
} else {
333+
if (!serial.connected) {
334+
GUI.timeout_remove("connecting"); // kill connecting timer
335+
abortConnection();
336+
return;
337+
}
338+
333339
const dialog = $(".dialogConnectWarning")[0];
334340

335341
$(".dialogConnectWarning-content").html(
@@ -528,7 +534,7 @@ async function processUid() {
528534

529535
gui_log(i18n.getMessage("uniqueDeviceIdReceived", FC.CONFIG.deviceIdentifier));
530536

531-
await sendConfigTracking();
537+
await sendConfigTracking();
532538
await processBuildConfiguration();
533539
}
534540

0 commit comments

Comments
 (0)