Cancel in-flight diagnostic poll when user selects a new port
Lint / Python (flake8) (push) Skipped
Lint / JS (eslint) (push) Skipped

Previously switching ports while a diagnostic was running left the
setInterval timer active, causing the result to be written into the
old (now detached) DOM elements and never shown to the user.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-11 23:26:53 -04:00
co-authored by Claude Sonnet 4.6
parent 2896692d93
commit 8173b9dc7f
+1
View File
@@ -218,6 +218,7 @@ let _apiData = null;
function selectPort(el) {
const swName = el.dataset.switch;
const idx = parseInt(el.dataset.portIdx, 10);
if (_diagPollTimer) { clearInterval(_diagPollTimer); _diagPollTimer = null; }
document.querySelectorAll('.switch-port-block.selected')
.forEach(e => e.classList.remove('selected'));
el.classList.add('selected');