Made Aircrafts fetch from Server. Added OSM Objects to mission
This commit is contained in:
@@ -30,7 +30,13 @@ export function QueryProvider({ children }: { children: ReactNode }) {
|
||||
|
||||
const invalidateConnectedUsers = () => {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ["connected-users"],
|
||||
queryKey: ["connected-users", "aircrafts"],
|
||||
});
|
||||
};
|
||||
|
||||
const invalidateConenctedAircrafts = () => {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ["aircrafts"],
|
||||
});
|
||||
};
|
||||
|
||||
@@ -39,6 +45,7 @@ export function QueryProvider({ children }: { children: ReactNode }) {
|
||||
dispatchSocket.on("new-mission", invalidateMission);
|
||||
dispatchSocket.on("dispatchers-update", invalidateConnectedUsers);
|
||||
dispatchSocket.on("pilots-update", invalidateConnectedUsers);
|
||||
dispatchSocket.on("update-connectedAircraft", invalidateConenctedAircrafts);
|
||||
}, [queryClient]);
|
||||
|
||||
return (
|
||||
|
||||
@@ -86,7 +86,12 @@ export const Chat = () => {
|
||||
</option>
|
||||
)}
|
||||
|
||||
{connectedUser?.map((user) => (
|
||||
{[
|
||||
...(connectedUser?.filter(
|
||||
(user, idx, arr) =>
|
||||
arr.findIndex((u) => u.userId === user.userId) === idx,
|
||||
) || []),
|
||||
].map((user) => (
|
||||
<option key={user.userId} value={user.userId}>
|
||||
{asPublicUser(user.publicUser).fullName}
|
||||
</option>
|
||||
|
||||
@@ -75,9 +75,14 @@ export const Report = () => {
|
||||
Chatpartner auswählen
|
||||
</option>
|
||||
)}
|
||||
{connectedUser?.map((user) => (
|
||||
{[
|
||||
...(connectedUser?.filter(
|
||||
(user, idx, arr) =>
|
||||
arr.findIndex((u) => u.userId === user.userId) === idx,
|
||||
) || []),
|
||||
].map((user) => (
|
||||
<option key={user.userId} value={user.userId}>
|
||||
{asPublicUser(user).fullName}
|
||||
{asPublicUser(user.publicUser).fullName}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user