This commit is contained in:
PxlLoewe
2025-10-04 19:53:56 +02:00
parent f691eb5f7c
commit 859b8519db
5 changed files with 68 additions and 15 deletions

View File

@@ -6,8 +6,10 @@ export const sendAlert = async (
id: number,
{
stationId,
desktopOnly,
}: {
stationId?: number;
desktopOnly?: boolean;
},
user: User | "HPG",
): Promise<{
@@ -46,10 +48,13 @@ export const sendAlert = async (
});
for (const aircraft of connectedAircrafts) {
io.to(`station:${aircraft.stationId}`).emit("mission-alert", {
...mission,
Stations,
});
if (!desktopOnly) {
io.to(`station:${aircraft.stationId}`).emit("mission-alert", {
...mission,
Stations,
});
}
io.to(`desktop:${aircraft.userId}`).emit("mission-alert", {
missionId: mission.id,
});