fix: handling wwebjs erros without blocking routes

This commit is contained in:
canove
2020-09-22 16:33:13 -03:00
parent 0d8b4cd60c
commit 5c7a759efa
7 changed files with 80 additions and 74 deletions

View File

@@ -6,6 +6,22 @@ let io: SocketIO;
export const initIO = (httpServer: Server): SocketIO => {
io = socketIo(httpServer);
io.on("connection", socket => {
console.log("Client Connected");
socket.on("joinChatBox", ticketId => {
console.log("A client joined a ticket channel");
socket.join(ticketId);
});
socket.on("joinNotification", () => {
console.log("A client joined notification channel");
socket.join("notification");
});
socket.on("disconnect", () => {
console.log("Client disconnected");
});
});
return io;
};
export const getIO = (): SocketIO => {