fixed force end call

This commit is contained in:
PxlLoewe
2025-06-03 23:16:46 -07:00
parent 0eb3ba8104
commit 2da27298bc
5 changed files with 58 additions and 64 deletions

View File

@@ -74,31 +74,6 @@ export const handleConnectDispatch =
io.to("dispatchers").emit("dispatchers-update", connectedDispatcherEntry);
io.to("pilots").emit("dispatchers-update", connectedDispatcherEntry);
socket.on("stop-other-transmition", async ({ ownRole, otherRole }) => {
const aircrafts = await prisma.connectedAircraft.findMany({
where: {
Station: {
bosCallsignShort: otherRole,
},
logoutTime: null,
},
include: {
Station: true,
},
});
const dispatchers = await prisma.connectedDispatcher.findMany({
where: {
zone: otherRole,
logoutTime: null,
},
});
[...aircrafts, ...dispatchers].forEach((entry) => {
io.to(`user:${entry.userId}`).emit("force-end-transmission", {
by: ownRole,
});
});
});
socket.on("disconnect", async () => {
await prisma.connectedDispatcher.update({
where: {