Added Status 6 for MissionAuto-close
This commit is contained in:
@@ -51,10 +51,21 @@ const removeClosedMissions = async () => {
|
||||
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 (
|
||||
status4Log !== -1 &&
|
||||
status1Log !== -1 &&
|
||||
(status4Log < status1Log || status8Log < status1Log)
|
||||
(status1Log !== -1 || status6Log !== -1) &&
|
||||
(status4Log < status1Log ||
|
||||
status8Log < status1Log ||
|
||||
status8Log < status6Log ||
|
||||
status1Log < status6Log)
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -104,7 +115,7 @@ const removeClosedMissions = async () => {
|
||||
io.to("dispatchers").emit("notification", {
|
||||
type: "mission-auto-close",
|
||||
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: {
|
||||
missionId: updatedMission.id,
|
||||
publicMissionId: updatedMission.publicId,
|
||||
|
||||
Reference in New Issue
Block a user