From bf578c79e797c9e3a270fede674f840b3d2496cb Mon Sep 17 00:00:00 2001 From: Rajeh Taher Date: Mon, 7 Oct 2024 21:26:32 +0300 Subject: [PATCH] fix(master): Fixes prop hash reset due to missing property in the response --- src/Socket/chats.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Socket/chats.ts b/src/Socket/chats.ts index 0ca11d7..bddd210 100644 --- a/src/Socket/chats.ts +++ b/src/Socket/chats.ts @@ -773,8 +773,10 @@ export const makeChatsSocket = (config: SocketConfig) => { let props: { [_: string]: string } = {} if(propsNode) { - authState.creds.lastPropHash = propsNode?.attrs?.hash - ev.emit('creds.update', authState.creds) + if(propsNode.attrs?.hash) { // on some clients, the hash is returning as undefined + authState.creds.lastPropHash = propsNode?.attrs?.hash + ev.emit('creds.update', authState.creds) + } props = reduceBinaryNodeToDictionary(propsNode, 'prop') }