mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
connect fail bug fix
This commit is contained in:
@@ -12,9 +12,14 @@ export default class WAConnectionConnector extends WAConnectionValidator {
|
|||||||
* @return returns [userMetaData, chats, contacts, unreadMessages]
|
* @return returns [userMetaData, chats, contacts, unreadMessages]
|
||||||
*/
|
*/
|
||||||
async connect(authInfo: AuthenticationCredentialsBase64 | string = null, timeoutMs: number = null) {
|
async connect(authInfo: AuthenticationCredentialsBase64 | string = null, timeoutMs: number = null) {
|
||||||
const userInfo = await this.connectSlim(authInfo, timeoutMs)
|
try {
|
||||||
const chats = await this.receiveChatsAndContacts(timeoutMs)
|
const userInfo = await this.connectSlim(authInfo, timeoutMs)
|
||||||
return [userInfo, ...chats] as [UserMetaData, WAChat[], WAContact[], WAMessage[]]
|
const chats = await this.receiveChatsAndContacts(timeoutMs)
|
||||||
|
return [userInfo, ...chats] as [UserMetaData, WAChat[], WAContact[], WAMessage[]]
|
||||||
|
} catch (error) {
|
||||||
|
this.close ()
|
||||||
|
throw error
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Connect to WhatsAppWeb, resolves without waiting for chats & contacts
|
* Connect to WhatsAppWeb, resolves without waiting for chats & contacts
|
||||||
|
|||||||
Reference in New Issue
Block a user