Deine Commit-Nachricht
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,7 @@
|
|||||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
letsencrypt
|
||||||
|
|
||||||
# Grafana
|
# Grafana
|
||||||
grafana
|
grafana
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,6 @@ router.post("/set-standard-name", async (req, res) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
let eventRoles: string[] = [];
|
|
||||||
|
|
||||||
participant.forEach(async (p) => {
|
participant.forEach(async (p) => {
|
||||||
if (!p.Event.discordRoleId) return;
|
if (!p.Event.discordRoleId) return;
|
||||||
if (eventCompleted(p.Event, p)) {
|
if (eventCompleted(p.Event, p)) {
|
||||||
@@ -47,7 +45,7 @@ router.post("/set-standard-name", async (req, res) => {
|
|||||||
const publicUser = getPublicUser(user);
|
const publicUser = getPublicUser(user);
|
||||||
const member = await getMember(memberId);
|
const member = await getMember(memberId);
|
||||||
|
|
||||||
await member.setNickname(`${publicUser.fullName} (${user.publicId})`);
|
await member.setNickname(`${publicUser.fullName} - ${user.publicId}`);
|
||||||
const isPilot = user.permissions.includes("PILOT");
|
const isPilot = user.permissions.includes("PILOT");
|
||||||
const isDispatcher = user.permissions.includes("DISPO");
|
const isDispatcher = user.permissions.includes("DISPO");
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ export const Chat = () => {
|
|||||||
refetchInterval: 10000,
|
refetchInterval: 10000,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if(!session.data?.user.id) return;
|
||||||
|
setOwnId(session.data?.user.id);
|
||||||
|
}, [session.data?.user.id]);
|
||||||
|
|
||||||
const filteredDispatcher = dispatcher?.filter((d) => d.userId !== session.data?.user.id);
|
const filteredDispatcher = dispatcher?.filter((d) => d.userId !== session.data?.user.id);
|
||||||
const filteredAircrafts = aircrafts?.filter((a) => a.userId !== session.data?.user.id);
|
const filteredAircrafts = aircrafts?.filter((a) => a.userId !== session.data?.user.id);
|
||||||
|
|
||||||
|
|||||||
@@ -35,13 +35,24 @@ export const useLeftMenuStore = create<ChatStore>((set, get) => ({
|
|||||||
chats: {},
|
chats: {},
|
||||||
sendMessage: (userId: string, message: string) => {
|
sendMessage: (userId: string, message: string) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
dispatchSocket.emit("send-message", { userId, message }, ({ error }: { error?: string }) => {
|
if(dispatchSocket.connected){
|
||||||
if (error) {
|
|
||||||
reject(error);
|
dispatchSocket.emit("send-message", { userId, message }, ({ error }: { error?: string }) => {
|
||||||
} else {
|
if (error) {
|
||||||
resolve();
|
reject(error);
|
||||||
}
|
} else {
|
||||||
});
|
resolve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if(pilotSocket.connected){
|
||||||
|
pilotSocket.emit("send-message", { userId, message }, ({ error }: { error?: string }) => {
|
||||||
|
if (error) {
|
||||||
|
reject(error);
|
||||||
|
} else {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
addChat: (userId, name) => {
|
addChat: (userId, name) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user