mirror of
https://github.com/smittix/intercept.git
synced 2026-04-25 07:10:00 -07:00
Fix orbit track to use selected pass's satellite, not dropdown
Bug: Both files were fetching orbit data for the dropdown-selected satellite instead of the satellite from the selected pass. Fixes: - satellite_dashboard.html: updateRealTimePositions() now uses passes[selectedPass].satellite instead of selectedSatellite - index.html: updateRealTimePosition() now ensures the selected pass's satellite is included in the position request, and added includeTrack: true to get orbit data 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1344,7 +1344,17 @@
|
||||
async function updateRealTimePositions() {
|
||||
const lat = parseFloat(document.getElementById('obsLat').value);
|
||||
const lon = parseFloat(document.getElementById('obsLon').value);
|
||||
const satColor = satellites[selectedSatellite]?.color || '#00d4ff';
|
||||
|
||||
// Use satellite from selected pass, or fall back to dropdown selection
|
||||
let targetSatellite = selectedSatellite;
|
||||
let satColor = satellites[selectedSatellite]?.color || '#00d4ff';
|
||||
|
||||
if (selectedPass !== null && passes[selectedPass]) {
|
||||
const pass = passes[selectedPass];
|
||||
// Use the satellite name from the pass (backend accepts names or NORAD IDs)
|
||||
targetSatellite = pass.satellite;
|
||||
satColor = pass.color || satColor;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch('/satellite/position', {
|
||||
@@ -1353,7 +1363,7 @@
|
||||
body: JSON.stringify({
|
||||
latitude: lat,
|
||||
longitude: lon,
|
||||
satellites: [selectedSatellite],
|
||||
satellites: [targetSatellite],
|
||||
includeTrack: true
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user