From 1e58812f504e4bfd54859bfd5c85ab7debd0cefd Mon Sep 17 00:00:00 2001 From: James Smith Date: Tue, 30 Dec 2025 15:37:04 +0000 Subject: [PATCH] Fix dashboard satellite change timing issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove duplicate updateRealTimePositions() call from onSatelliteChange() since calculatePasses() already calls selectPass() which triggers it - Clear passes and selectedPass when changing satellites to prevent using stale data - Clear map layers when changing satellites 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- templates/satellite_dashboard.html | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/templates/satellite_dashboard.html b/templates/satellite_dashboard.html index 8c673a4..acf0c14 100644 --- a/templates/satellite_dashboard.html +++ b/templates/satellite_dashboard.html @@ -901,11 +901,20 @@ document.getElementById('trackingStatus').textContent = 'ACQUIRING ' + satName; document.getElementById('trackingDot').style.background = 'var(--accent-orange)'; - // Recalculate passes for new satellite - calculatePasses(); + // Clear current pass selection while loading new data + selectedPass = null; + passes = []; - // Update real-time position immediately - updateRealTimePositions(); + // Clear map layers from previous satellite + if (groundMap) { + if (trackLine) { groundMap.removeLayer(trackLine); trackLine = null; } + if (satMarker) { groundMap.removeLayer(satMarker); satMarker = null; } + if (orbitTrack) { groundMap.removeLayer(orbitTrack); orbitTrack = null; } + } + + // Recalculate passes for new satellite + // calculatePasses() will call selectPass(0) which calls updateRealTimePositions() + calculatePasses(); } // Initialize dashboard