Skip to content

Commit 2d50dc2

Browse files
committed
Use reset connection to clear timestamp
1 parent 615dca3 commit 2d50dc2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/js/serial_backend.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,14 @@ function resetConnection() {
245245
CONFIGURATOR.cliEngineValid = false;
246246
CONFIGURATOR.cliEngineActive = false;
247247

248+
// Clear connection timestamp
249+
connectionTimestamp = null;
250+
setTimeout(() => {
251+
if (window.vm?.CONNECTION) {
252+
window.vm.CONNECTION.timestamp = null;
253+
}
254+
}, 100);
255+
248256
// unlock port select & baud
249257
PortHandler.portPickerDisabled = false;
250258
}
@@ -678,14 +686,6 @@ function onConnect() {
678686
function onClosed(result) {
679687
gui_log(i18n.getMessage(result ? "serialPortClosedOk" : "serialPortClosedFail"));
680688

681-
// Clear connection timestamp
682-
connectionTimestamp = null;
683-
setTimeout(() => {
684-
if (window.vm?.CONNECTION) {
685-
window.vm.CONNECTION.timestamp = null;
686-
}
687-
}, 100);
688-
689689
$("#tabs ul.mode-connected").hide();
690690
$("#tabs ul.mode-connected-cli").hide();
691691
$("#tabs ul.mode-disconnected").show();

0 commit comments

Comments
 (0)