Added Status 6 for MissionAuto-close

This commit is contained in:
PxlLoewe
2025-07-15 23:46:59 -07:00
parent 515ff6d6c3
commit 46fdd2e0c2
2 changed files with 16 additions and 5 deletions

View File

@@ -51,10 +51,21 @@ const removeClosedMissions = async () => {
l.data?.newFMSstatus === "1" l.data?.newFMSstatus === "1"
); );
}); });
const status6Log = (mission.missionLog as unknown as MissionLog[]).findIndex((l) => {
return (
l.type === "station-log" &&
l.data?.stationId === stationId &&
l.data?.newFMSstatus === "6"
);
});
return ( return (
status4Log !== -1 && status4Log !== -1 &&
status1Log !== -1 && (status1Log !== -1 || status6Log !== -1) &&
(status4Log < status1Log || status8Log < status1Log) (status4Log < status1Log ||
status8Log < status1Log ||
status8Log < status6Log ||
status1Log < status6Log)
); );
}, },
); );
@@ -104,7 +115,7 @@ const removeClosedMissions = async () => {
io.to("dispatchers").emit("notification", { io.to("dispatchers").emit("notification", {
type: "mission-auto-close", type: "mission-auto-close",
status: "chron", status: "chron",
message: `Einsatz ${updatedMission.publicId} wurde aufgrund von Inaktivität geschlossen.`, message: `Einsatz ${updatedMission.publicId} wurde aufgrund ${allStationsInMissionChangedFromStatus4to1Or8to1 ? "des Freimeldens aller Stationen" : "von Inaktivität"} geschlossen.`,
data: { data: {
missionId: updatedMission.id, missionId: updatedMission.id,
publicMissionId: updatedMission.publicId, publicMissionId: updatedMission.publicId,

View File

@@ -151,7 +151,7 @@ export const HorizontalNav = async () => {
target="_blank" target="_blank"
> >
<button className="btn btn-sm btn-outline btn-primary"> <button className="btn btn-sm btn-outline btn-primary">
<Workflow /> Zur Leitstelle <Workflow /> Disponent
</button> </button>
</a> </a>
)} )}
@@ -162,7 +162,7 @@ export const HorizontalNav = async () => {
target="_blank" target="_blank"
> >
<button className="btn btn-sm btn-outline btn-primary"> <button className="btn btn-sm btn-outline btn-primary">
<Plane /> Zum Operations Center <Plane /> Pilot
</button> </button>
</a> </a>
)} )}