This commit is contained in:
nocnico
2025-07-25 01:11:53 +02:00
parent 08c4cfe082
commit 26430c00ea
9 changed files with 249 additions and 104 deletions

View File

@@ -47,7 +47,10 @@ export const StatusToast = ({ event, t }: { event: StationStatus; t: Toast }) =>
}
}, []);
const [aircraftDataAcurate, setAircraftDataAccurate] = useState(false);
const mapStore = useMapStore((s) => s);
//const mapStore = useMapStore((s) => s);
const { openAircraftMarker, setOpenAircraftMarker, userSettings, setMap } = useMapStore(
(store) => store,
);
const { data: connectedAircrafts } = useQuery({
queryKey: ["aircrafts"],
@@ -129,11 +132,18 @@ export const StatusToast = ({ event, t }: { event: StationStatus; t: Toast }) =>
className="mr-1 cursor-pointer font-bold underline"
onClick={() => {
if (!connectedAircraft.posLat || !connectedAircraft.posLng) return;
mapStore.setOpenAircraftMarker({
open: [{ id: connectedAircraft.id, tab: "fms" }],
close: [],
});
mapStore.setMap({
if (userSettings.settingsAutoCloseMapPopup) {
setOpenAircraftMarker({
open: [{ id: connectedAircraft.id, tab: "fms" }],
close: openAircraftMarker?.map((m) => m.id) || [],
});
} else {
setOpenAircraftMarker({
open: [{ id: connectedAircraft.id, tab: "fms" }],
close: [],
});
}
setMap({
center: [connectedAircraft.posLat, connectedAircraft.posLng],
zoom: 14,
});