mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
possibly more reliable connect
This commit is contained in:
@@ -36,10 +36,12 @@ export class WAConnection extends Base {
|
||||
})
|
||||
|
||||
try {
|
||||
await promise
|
||||
|
||||
const tasks = [promise]
|
||||
|
||||
const waitForChats = typeof options?.waitForChats === 'undefined' ? true : options?.waitForChats
|
||||
waitForChats && await this.receiveChatsAndContacts(options?.timeoutMs, true)
|
||||
if (waitForChats) tasks.push (this.receiveChatsAndContacts(options?.timeoutMs, true))
|
||||
|
||||
await Promise.all (tasks)
|
||||
|
||||
this.phoneConnected = true
|
||||
this.state = 'open'
|
||||
|
||||
Reference in New Issue
Block a user