connected Dispatcher

This commit is contained in:
PxlLoewe
2025-07-08 17:51:48 -07:00
parent cce499e27e
commit 44abbc57b6
3 changed files with 4 additions and 2 deletions

View File

@@ -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(),

View File

@@ -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) {

View File

@@ -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,
}); });