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 <noreply@anthropic.com>
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user