fix: can't load messages when ther's no whatsapp session

This commit is contained in:
canove
2020-08-20 18:29:45 -03:00
parent d8346f902c
commit 92743a5210

View File

@@ -23,7 +23,13 @@ const setMessagesAsRead = async ticket => {
}
);
await wbot.sendSeen(`${ticket.contact.number}@c.us`);
try {
await wbot.sendSeen(`${ticket.contact.number}@c.us`);
} catch (err) {
console.log(
"Could not mark messages as read. Maybe whatsapp session disconnected?"
);
}
io.to("notification").emit("ticket", {
action: "updateUnread",