resolves #96
This commit is contained in:
@@ -15,10 +15,19 @@ export const HPGnotificationToast = ({
|
||||
}) => {
|
||||
const handleClick = () => {
|
||||
toast.dismiss(t.id);
|
||||
mapStore.setOpenMissionMarker({
|
||||
open: [{ id: event.data.mission.id, tab: "home" }],
|
||||
close: [],
|
||||
});
|
||||
|
||||
if (mapStore.userSettings.settingsAutoCloseMapPopup) {
|
||||
mapStore.setOpenMissionMarker({
|
||||
open: [{ id: event.data.mission.id, tab: "home" }],
|
||||
close: mapStore.openMissionMarker?.map((m) => m.id) || [],
|
||||
});
|
||||
} else {
|
||||
mapStore.setOpenMissionMarker({
|
||||
open: [{ id: event.data.mission.id, tab: "home" }],
|
||||
close: [],
|
||||
});
|
||||
}
|
||||
|
||||
mapStore.setMap({
|
||||
center: [event.data.mission.addressLat, event.data.mission.addressLng],
|
||||
zoom: 14,
|
||||
@@ -29,7 +38,7 @@ export const HPGnotificationToast = ({
|
||||
return (
|
||||
<BaseNotification icon={<Cross />} className="flex flex-row">
|
||||
<div className="flex-1">
|
||||
<h1 className="text-red-500 font-bold">HPG validierung fehlgeschlagen</h1>
|
||||
<h1 className="font-bold text-red-500">HPG validierung fehlgeschlagen</h1>
|
||||
<p>{event.message}</p>
|
||||
</div>
|
||||
<div className="ml-11">
|
||||
@@ -43,7 +52,7 @@ export const HPGnotificationToast = ({
|
||||
return (
|
||||
<BaseNotification icon={<Check />} className="flex flex-row">
|
||||
<div className="flex-1">
|
||||
<h1 className="text-green-600 font-bold">HPG validierung erfolgreich</h1>
|
||||
<h1 className="font-bold text-green-600">HPG validierung erfolgreich</h1>
|
||||
<p className="text-sm">{event.message}</p>
|
||||
</div>
|
||||
<div className="ml-11">
|
||||
|
||||
@@ -65,15 +65,27 @@ export const MissionAutoCloseToast = ({
|
||||
lng: mission.addressLng,
|
||||
},
|
||||
});
|
||||
mapStore.setOpenMissionMarker({
|
||||
open: [
|
||||
{
|
||||
id: mission.id,
|
||||
tab: "home",
|
||||
},
|
||||
],
|
||||
close: [],
|
||||
});
|
||||
if (mapStore.userSettings.settingsAutoCloseMapPopup) {
|
||||
mapStore.setOpenMissionMarker({
|
||||
open: [
|
||||
{
|
||||
id: mission.id,
|
||||
tab: "home",
|
||||
},
|
||||
],
|
||||
close: mapStore.openMissionMarker?.map((m) => m.id) || [],
|
||||
});
|
||||
} else {
|
||||
mapStore.setOpenMissionMarker({
|
||||
open: [
|
||||
{
|
||||
id: mission.id,
|
||||
tab: "home",
|
||||
},
|
||||
],
|
||||
close: [],
|
||||
});
|
||||
}
|
||||
toast.dismiss(t.id);
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user