From b141ac2c0047e91081f7f42b4b2295a8b81ac447 Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Fri, 25 Nov 2022 10:17:47 +0530 Subject: [PATCH] chore: only buffer if logged in --- src/Socket/socket.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Socket/socket.ts b/src/Socket/socket.ts index 34b546a..69c3581 100644 --- a/src/Socket/socket.ts +++ b/src/Socket/socket.ts @@ -533,8 +533,12 @@ export const makeSocket = ({ }) process.nextTick(() => { - // start buffering important events - ev.buffer() + if(creds.me?.id) { + // start buffering important events + // if we're logged in + ev.buffer() + } + ev.emit('connection.update', { connection: 'connecting', receivedPendingNotifications: false, qr: undefined }) }) // update credentials when required