From 54c78b37042abcd7588fd0cfd1631fd4dde748b6 Mon Sep 17 00:00:00 2001 From: luctra02 <64017398+luctra02@users.noreply.github.com> Date: Wed, 28 Feb 2024 12:50:07 +0100 Subject: [PATCH] feat(frontend): :sparkles: Handle satellite data from celestrak in any format (#107) --- frontend/src/components/map/SatelliteFetcher.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/map/SatelliteFetcher.tsx b/frontend/src/components/map/SatelliteFetcher.tsx index fd88511..4055d0a 100644 --- a/frontend/src/components/map/SatelliteFetcher.tsx +++ b/frontend/src/components/map/SatelliteFetcher.tsx @@ -45,12 +45,11 @@ export default async function SatelliteFetcher({ (satEntity) => { const celestrakURL = satEntity?.attributes?.celestrakURL; if (celestrakURL) { - return celestrakURL; + return celestrakURL.replace(/FORMAT=[^&]*/, "FORMAT=TLE"); } return ( "https://celestrak.org/NORAD/elements/gp.php?CATNR=" + - satEntity?.attributes?.catalogNumberNORAD + - "&FORMAT=TLE" + satEntity?.attributes?.catalogNumberNORAD ); }, ) as string[];