Retain existing authState.creds.me properties when updating lid during creds update event

This commit is contained in:
Ahmad Syauqi
2023-12-28 15:47:45 +08:00
parent b7463ea6c4
commit 9df3d2410a

View File

@@ -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' })
})