mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 19:59:20 +00:00
added new "last message" logic, before useReducer
This commit is contained in:
@@ -13,7 +13,7 @@ const wbotMonitor = () => {
|
||||
const wbot = getWbot();
|
||||
|
||||
wbot.on("change_state", newState => {
|
||||
console.log(newState);
|
||||
console.log("monitor", newState);
|
||||
});
|
||||
|
||||
wbot.on("change_battery", batteryInfo => {
|
||||
@@ -27,7 +27,10 @@ const wbotMonitor = () => {
|
||||
wbot.destroy();
|
||||
setTimeout(() =>
|
||||
init()
|
||||
.then(res => wbotMessageListener(), 2000)
|
||||
.then(res => {
|
||||
wbotMessageListener();
|
||||
wbotMonitor();
|
||||
})
|
||||
.catch(err => console.log(err))
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user