cleanup openMarkerSettings
This commit is contained in:
@@ -48,9 +48,7 @@ export const StatusToast = ({ event, t }: { event: StationStatus; t: Toast }) =>
|
||||
}, []);
|
||||
const [aircraftDataAcurate, setAircraftDataAccurate] = useState(false);
|
||||
//const mapStore = useMapStore((s) => s);
|
||||
const { openAircraftMarker, setOpenAircraftMarker, userSettings, setMap } = useMapStore(
|
||||
(store) => store,
|
||||
);
|
||||
const { setOpenAircraftMarker, setMap } = useMapStore((store) => store);
|
||||
|
||||
const { data: connectedAircrafts } = useQuery({
|
||||
queryKey: ["aircrafts"],
|
||||
@@ -132,17 +130,11 @@ export const StatusToast = ({ event, t }: { event: StationStatus; t: Toast }) =>
|
||||
className="mr-1 cursor-pointer font-bold underline"
|
||||
onClick={() => {
|
||||
if (!connectedAircraft.posLat || !connectedAircraft.posLng) return;
|
||||
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: [],
|
||||
});
|
||||
}
|
||||
|
||||
setOpenAircraftMarker({
|
||||
open: [{ id: connectedAircraft.id, tab: "fms" }],
|
||||
close: [],
|
||||
});
|
||||
setMap({
|
||||
center: [connectedAircraft.posLat, connectedAircraft.posLng],
|
||||
zoom: 14,
|
||||
|
||||
@@ -250,27 +250,15 @@ const AircraftMarker = ({ aircraft }: { aircraft: ConnectedAircraft & { Station:
|
||||
close: [aircraft.id],
|
||||
});
|
||||
} else {
|
||||
if (userSettings.settingsAutoCloseMapPopup) {
|
||||
setOpenAircraftMarker({
|
||||
open: [
|
||||
{
|
||||
id: aircraft.id,
|
||||
tab: "home",
|
||||
},
|
||||
],
|
||||
close: openAircraftMarker?.map((m) => m.id) || [],
|
||||
});
|
||||
} else {
|
||||
setOpenAircraftMarker({
|
||||
open: [
|
||||
{
|
||||
id: aircraft.id,
|
||||
tab: "home",
|
||||
},
|
||||
],
|
||||
close: [],
|
||||
});
|
||||
}
|
||||
setOpenAircraftMarker({
|
||||
open: [
|
||||
{
|
||||
id: aircraft.id,
|
||||
tab: "home",
|
||||
},
|
||||
],
|
||||
close: [],
|
||||
});
|
||||
}
|
||||
};
|
||||
const marker = markerRef.current;
|
||||
|
||||
@@ -246,27 +246,15 @@ const MissionMarker = ({
|
||||
close: [mission.id],
|
||||
});
|
||||
} else {
|
||||
if (userSettings.settingsAutoCloseMapPopup) {
|
||||
setOpenMissionMarker({
|
||||
open: [
|
||||
{
|
||||
id: mission.id,
|
||||
tab: "home",
|
||||
},
|
||||
],
|
||||
close: openMissionMarker?.map((m) => m.id) || [],
|
||||
});
|
||||
} else {
|
||||
setOpenMissionMarker({
|
||||
open: [
|
||||
{
|
||||
id: mission.id,
|
||||
tab: "home",
|
||||
},
|
||||
],
|
||||
close: [],
|
||||
});
|
||||
}
|
||||
setOpenMissionMarker({
|
||||
open: [
|
||||
{
|
||||
id: mission.id,
|
||||
tab: "home",
|
||||
},
|
||||
],
|
||||
close: openMissionMarker?.map((m) => m.id) || [],
|
||||
});
|
||||
}
|
||||
};
|
||||
const markerCopy = markerRef.current;
|
||||
|
||||
Reference in New Issue
Block a user