connected Dispatcher
This commit is contained in:
@@ -33,6 +33,7 @@ router.patch("/:id", async (req, res) => {
|
|||||||
userId: newDispatcher.userId,
|
userId: newDispatcher.userId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (discordAccount?.id) {
|
if (discordAccount?.id) {
|
||||||
await renameMember(
|
await renameMember(
|
||||||
discordAccount.discordId.toString(),
|
discordAccount.discordId.toString(),
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export const handleConnectDispatch =
|
|||||||
socket.join("dispatchers"); // Dem Dispatcher-Raum beitreten
|
socket.join("dispatchers"); // Dem Dispatcher-Raum beitreten
|
||||||
socket.join(`user:${user.id}`); // Dem User-Raum beitreten
|
socket.join(`user:${user.id}`); // Dem User-Raum beitreten
|
||||||
|
|
||||||
io.to(`user:${user.id}`).emit("dispatchers-update", connectedDispatcherEntry);
|
io.to(`user:${user.id}`).emit("own-dispatcher", connectedDispatcherEntry);
|
||||||
io.to("dispatchers").emit("dispatchers-update", connectedDispatcherEntry);
|
io.to("dispatchers").emit("dispatchers-update", connectedDispatcherEntry);
|
||||||
io.to("pilots").emit("dispatchers-update", connectedDispatcherEntry);
|
io.to("pilots").emit("dispatchers-update", connectedDispatcherEntry);
|
||||||
|
|
||||||
@@ -90,6 +90,7 @@ export const handleConnectDispatch =
|
|||||||
logoutTime: new Date().toISOString(),
|
logoutTime: new Date().toISOString(),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
io.to("dispatchers").emit("dispatchers-update");
|
io.to("dispatchers").emit("dispatchers-update");
|
||||||
io.to("pilots").emit("dispatchers-update");
|
io.to("pilots").emit("dispatchers-update");
|
||||||
if (discordAccount?.id) {
|
if (discordAccount?.id) {
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ dispatchSocket.on("force-disconnect", (reason: string) => {
|
|||||||
message: reason,
|
message: reason,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
dispatchSocket.on("dispatchers-update", (dispatch: ConnectedDispatcher) => {
|
dispatchSocket.on("own-dispatcher", (dispatch: ConnectedDispatcher) => {
|
||||||
useDispatchConnectionStore.setState({
|
useDispatchConnectionStore.setState({
|
||||||
connectedDispatcher: dispatch,
|
connectedDispatcher: dispatch,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user