mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 03:39:29 +00:00
improvement: better names on wbot methods
This commit is contained in:
@@ -47,6 +47,8 @@ const reducer = (state, action) => {
|
||||
if (action.type === "DELETE_SESSION") {
|
||||
const sessionId = action.payload;
|
||||
|
||||
console.log("cai aqui", sessionId);
|
||||
|
||||
const sessionIndex = state.findIndex(s => s.id === sessionId);
|
||||
if (sessionIndex !== -1) {
|
||||
state.splice(sessionIndex, 1);
|
||||
@@ -123,6 +125,12 @@ const WhatsAuth = () => {
|
||||
}
|
||||
});
|
||||
|
||||
socket.on("session", data => {
|
||||
if (data.action === "delete") {
|
||||
dispatch({ type: "DELETE_SESSION", payload: data.sessionId });
|
||||
}
|
||||
});
|
||||
|
||||
return () => {
|
||||
socket.disconnect();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user