From 9df3d2410a326d0aa07021b8bc361d52985323c9 Mon Sep 17 00:00:00 2001 From: Ahmad Syauqi Date: Thu, 28 Dec 2023 15:47:45 +0800 Subject: [PATCH] Retain existing authState.creds.me properties when updating lid during creds update event --- src/Socket/socket.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Socket/socket.ts b/src/Socket/socket.ts index 71f7d14..04e8f0f 100644 --- a/src/Socket/socket.ts +++ b/src/Socket/socket.ts @@ -630,7 +630,7 @@ export const makeSocket = (config: SocketConfig) => { logger.info('opened connection to WA') clearTimeout(qrTimer) // will never happen in all likelyhood -- but just in case WA sends success on first try - ev.emit('creds.update', { me: { id: authState.creds.me!.id, lid: node.attrs.lid } }) + ev.emit('creds.update', { me: { ...authState.creds.me!, lid: node.attrs.lid } }) ev.emit('connection.update', { connection: 'open' }) })