From 70e89996a32be82e21ea9bc2a945d1d5244ddb7b Mon Sep 17 00:00:00 2001 From: canove Date: Sat, 3 Oct 2020 16:12:26 -0300 Subject: [PATCH] fix: connections page not updating on session changes --- backend/src/controllers/WhatsAppController.ts | 6 ------ backend/src/services/WbotServices/wbotMonitor.ts | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/backend/src/controllers/WhatsAppController.ts b/backend/src/controllers/WhatsAppController.ts index e147fa1..51ec7b9 100644 --- a/backend/src/controllers/WhatsAppController.ts +++ b/backend/src/controllers/WhatsAppController.ts @@ -9,12 +9,6 @@ import DeleteWhatsAppService from "../services/WhatsappService/DeleteWhatsAppSer import ListWhatsAppsService from "../services/WhatsappService/ListWhatsAppsService"; import ShowWhatsAppService from "../services/WhatsappService/ShowWhatsAppService"; import UpdateWhatsAppService from "../services/WhatsappService/UpdateWhatsAppService"; -// import Yup from "yup"; -// import Whatsapp from "../models/Whatsapp"; -// import { getIO } from "../libs/socket"; -// import { getWbot, initWbot, removeWbot } from "../libs/wbot"; -// import wbotMessageListener from "../services/wbotMessageListener"; -// import wbotMonitor from "../services/wbotMonitor"; interface WhatsappData { name: string; diff --git a/backend/src/services/WbotServices/wbotMonitor.ts b/backend/src/services/WbotServices/wbotMonitor.ts index 5f1995e..a1e98f2 100644 --- a/backend/src/services/WbotServices/wbotMonitor.ts +++ b/backend/src/services/WbotServices/wbotMonitor.ts @@ -21,7 +21,7 @@ const wbotMonitor = (whatsapp: Whatsapp): void => { console.log(err); } - io.emit("session", { + io.emit("whatsappSession", { action: "update", session: whatsapp }); @@ -40,7 +40,7 @@ const wbotMonitor = (whatsapp: Whatsapp): void => { console.log(err); } - io.emit("session", { + io.emit("whatsappSession", { action: "update", session: whatsapp }); @@ -55,7 +55,7 @@ const wbotMonitor = (whatsapp: Whatsapp): void => { console.log(err); } - io.emit("session", { + io.emit("whatsappSession", { action: "update", session: whatsapp });