From 2d6dcd782f5e4e6523b7305d47157d1672625764 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Mon, 11 May 2026 23:26:53 -0400 Subject: [PATCH] Cancel in-flight diagnostic poll when user selects a new port 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 --- templates/inspector.html | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/inspector.html b/templates/inspector.html index 7780ad2..baf9465 100644 --- a/templates/inspector.html +++ b/templates/inspector.html @@ -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');