fix: fire init queries in parallel

possible ghost session patch. cc @HUGEIT
This commit is contained in:
Adhiraj Singh
2022-03-22 22:41:23 +05:30
parent 9cacd5173c
commit 3cefad2c8e

View File

@@ -645,12 +645,13 @@ export const makeChatsSocket = (config: SocketConfig) => {
* help ensure parity with WA Web
* */
const fireInitQueries = async() => {
await fetchAbt()
await fetchProps()
await fetchBlocklist()
await fetchPrivacySettings()
await sendPresenceUpdate('available')
await Promise.all([
fetchAbt(),
fetchProps(),
fetchBlocklist(),
fetchPrivacySettings(),
sendPresenceUpdate('available')
])
}
ws.on('CB:presence', handlePresenceUpdate)