added auto disconnect when changing link
This commit is contained in:
@@ -70,6 +70,7 @@ export const handleConnectDispatch =
|
||||
socket.join("dispatchers"); // Dem Dispatcher-Raum beitreten
|
||||
socket.join(`user:${user.id}`); // Dem User-Raum beitreten
|
||||
|
||||
io.to(`user:${user.id}`).emit("dispatchers-update", connectedDispatcherEntry);
|
||||
io.to("dispatchers").emit("dispatchers-update");
|
||||
io.to("pilots").emit("dispatchers-update");
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ export const handleConnectPilot =
|
||||
(socket: Socket, io: Server) =>
|
||||
async ({ logoffTime, stationId }: { logoffTime: string; stationId: string }) => {
|
||||
try {
|
||||
if (!stationId) return Error("Station ID is required");
|
||||
const user: User = socket.data.user; // User ID aus dem JWT-Token
|
||||
const userId = socket.data.user.id; // User ID aus dem JWT-Token
|
||||
|
||||
|
||||
Reference in New Issue
Block a user