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 Jun 24, 2021
1 parent d7d9184 commit 082a80a
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 @@ -142,6 +142,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 082a80a

Please sign in to comment.