Skip to content

Commit

Permalink
fix: chat not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
jonalan7 committed Jul 1, 2021
1 parent 261920b commit 18281d3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib/wapi/functions/check-send-exist.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ export async function sendExist(chatId, returnChat = true, Send = true) {
let ck = await window.WAPI.checkNumberStatus(chatId),
chat = await window.WAPI.getChat(ck.id._serialized);

if (ck.numberExists && chat === undefined) {
var idUser = new window.Store.UserConstructor(chatId, {
intentionallyUsePrivateConstructor: true,
});
chat = await Store.Chat.find(idUser);
}

if (!chat) {
const storeChat = await window.Store.Chat.find(chatId);
if (storeChat) {
Expand Down

0 comments on commit 18281d3

Please sign in to comment.