fix(satellite): show 'NO UPCOMING PASSES' when all passes are in the past

updateCountdown fell back to passes[0] even when it was in the past,
showing 00:00:00:00 with a stale satellite name indefinitely. Now
displays a clear 'NO UPCOMING PASSES' state with '--' for all fields
when no future pass exists in the current prediction window.
This commit is contained in:
James Smith
2026-03-19 21:55:25 +00:00
parent f549957c0b
commit 33959403f4

View File

@@ -2438,7 +2438,18 @@
}
}
if (!nextPass) nextPass = passes[0];
if (!nextPass) {
// All passes in the current window are in the past
document.getElementById('countdownSat').textContent = 'NO UPCOMING PASSES';
document.getElementById('countDays').textContent = '--';
document.getElementById('countHours').textContent = '--';
document.getElementById('countMins').textContent = '--';
document.getElementById('countSecs').textContent = '--';
['countDays', 'countHours', 'countMins', 'countSecs'].forEach(id => {
document.getElementById(id)?.classList.remove('active');
});
return;
}
document.getElementById('countdownSat').textContent = nextPass.satellite;