From 6bd3a656f986b1c9b9e932dc3a1b22fb27a288a3 Mon Sep 17 00:00:00 2001 From: Vasilisk9812 Date: Sat, 5 Apr 2025 02:11:48 +0900 Subject: [PATCH] profile fix --- src/routes/ControlPanel.svelte | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/routes/ControlPanel.svelte b/src/routes/ControlPanel.svelte index be219f9..3f9c82d 100644 --- a/src/routes/ControlPanel.svelte +++ b/src/routes/ControlPanel.svelte @@ -42,7 +42,14 @@ const launch_datetime = formatLaunchDateTime(startDate, startTime); const getForecast = async () => { - // Create request object + const profileMap = { + 'Normal': 'standard_profile', + 'Float': 'float_profile', + 'Reverse (ascent only)': 'ascent_only_profile', + 'Custom': 'custom_profile' + }; + + // Create request object const request = { ascent_rate: parseFloat(ascentRate), burst_altitude: parseFloat(burstAltitude), @@ -53,7 +60,7 @@ launch_datetime, launch_latitude: parseFloat(inputLat), launch_longitude: parseFloat(inputLng), - profile: flightProfile === 'Normal' ? 'standard_profile' : 'custom_profile', + profile: profileMap[flightProfile] || 'standard_profile', version: 2 };