From f058958c13ce4263ac1546c4513f86a4607739eb Mon Sep 17 00:00:00 2001 From: Davide Passoni Date: Wed, 19 Mar 2025 16:33:10 +0100 Subject: [PATCH] fix: Coalition of unit bullseye info toggle now working --- frontend/react/src/ui/panels/optionsmenu.tsx | 30 ++++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/frontend/react/src/ui/panels/optionsmenu.tsx b/frontend/react/src/ui/panels/optionsmenu.tsx index 53946a1c..f33f11ab 100644 --- a/frontend/react/src/ui/panels/optionsmenu.tsx +++ b/frontend/react/src/ui/panels/optionsmenu.tsx @@ -41,17 +41,16 @@ export function OptionsMenu(props: { open: boolean; onClose: () => void; childre }, // Specify the content type }; - fetch(`./admin/config`, requestOptions) - .then((response) => { - if (response.status === 200) { - console.log(`Admin password correct`); - getApp().setAdminPassword(password); - getApp().setState(OlympusState.ADMIN) - return response.json(); - } else { - throw new Error("Admin password incorrect"); - } - }) + fetch(`./admin/config`, requestOptions).then((response) => { + if (response.status === 200) { + console.log(`Admin password correct`); + getApp().setAdminPassword(password); + getApp().setState(OlympusState.ADMIN); + return response.json(); + } else { + throw new Error("Admin password incorrect"); + } + }); }; useEffect(() => { @@ -215,7 +214,14 @@ export function OptionsMenu(props: { open: boolean; onClose: () => void; childre >
- {}} coalition={mapOptions.AWACSCoalition} /> + { + mapOptions.AWACSCoalition === "blue" && getApp().getMap().setOption("AWACSCoalition", "neutral"); + mapOptions.AWACSCoalition === "neutral" && getApp().getMap().setOption("AWACSCoalition", "red"); + mapOptions.AWACSCoalition === "red" && getApp().getMap().setOption("AWACSCoalition", "blue"); + }} + coalition={mapOptions.AWACSCoalition} + /> Coalition of unit bullseye info