From ae59d6e9c6ecc4d16b73ed13275fae18344b5ae1 Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Sat, 18 Dec 2021 22:30:03 +0530 Subject: [PATCH] fix: fire "connection-update" on legacy socket create --- src/LegacySocket/auth.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/LegacySocket/auth.ts b/src/LegacySocket/auth.ts index 4ccab6b..e612d63 100644 --- a/src/LegacySocket/auth.ts +++ b/src/LegacySocket/auth.ts @@ -220,6 +220,16 @@ const makeAuthSocket = (config: LegacySocketConfig) => { printQRIfNecessaryListener(ev, logger) } + process.nextTick(() => { + ev.emit('connection.update', { + connection: 'connecting', + receivedPendingNotifications: false, + legacy: { + phoneConnected: false + } + }) + }) + return { ...socket, state,