Added autoFocus on Sds and MissionLog
This commit is contained in:
@@ -14,32 +14,5 @@ export const handleConnectDesktop = (socket: Socket, io: Server) => () => {
|
||||
|
||||
socket.on("ptt", async (data: PTTData) => {
|
||||
socket.to(`user:${user.id}`).emit("ptt", data);
|
||||
const connectedAircraft = await prisma.connectedAircraft.findFirst({
|
||||
where: {
|
||||
userId: user.id,
|
||||
logoutTime: null,
|
||||
},
|
||||
include: {
|
||||
Station: true,
|
||||
},
|
||||
});
|
||||
|
||||
const connectedDispatcher = await prisma.connectedDispatcher.findFirst({
|
||||
where: {
|
||||
userId: user.id,
|
||||
logoutTime: null,
|
||||
},
|
||||
});
|
||||
const otherPttData = {
|
||||
publicUser: getPublicUser(user),
|
||||
source:
|
||||
connectedAircraft?.Station.bosCallsignShort || connectedDispatcher
|
||||
? "Leitstelle"
|
||||
: user.publicId,
|
||||
};
|
||||
if (data.shouldTransmit) {
|
||||
socket.to("dispatchers").emit("other-ptt", otherPttData);
|
||||
socket.to("pilots").emit("other-ptt", otherPttData);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -112,22 +112,6 @@ export const handleConnectPilot =
|
||||
connectedAircraftEntry,
|
||||
);
|
||||
|
||||
// Add a listener for station-specific events
|
||||
socket.on("ptt", async ({ shouldTransmit, channel }) => {
|
||||
if (shouldTransmit) {
|
||||
io.to("dispatchers").emit("other-ptt", {
|
||||
publicUser: getPublicUser(user),
|
||||
channel,
|
||||
source: Station?.bosCallsignShort,
|
||||
});
|
||||
io.to("piots").emit("other-ptt", {
|
||||
publicUser: getPublicUser(user),
|
||||
channel,
|
||||
source: Station?.bosCallsignShort,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
socket.on("disconnect", async () => {
|
||||
await prisma.connectedAircraft
|
||||
.update({
|
||||
|
||||
Reference in New Issue
Block a user