mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 12:19:16 +00:00
fix: handling wwebjs erros without blocking routes
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user