From 33959403f489b97f97f4cc3cd190501c57978e6c Mon Sep 17 00:00:00 2001 From: James Smith Date: Thu, 19 Mar 2026 21:55:25 +0000 Subject: [PATCH] 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. --- templates/satellite_dashboard.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/templates/satellite_dashboard.html b/templates/satellite_dashboard.html index 8beda39..f4344ca 100644 --- a/templates/satellite_dashboard.html +++ b/templates/satellite_dashboard.html @@ -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;