From a5d263d31be7f3244d399aa6c9c5e4e65380e8f1 Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Fri, 9 Dec 2022 10:15:58 +0530 Subject: [PATCH] fix: correctly sync app state --- src/Socket/chats.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Socket/chats.ts b/src/Socket/chats.ts index 64f3489..6056d13 100644 --- a/src/Socket/chats.ts +++ b/src/Socket/chats.ts @@ -725,7 +725,7 @@ export const makeChatsSocket = (config: SocketConfig) => { ) : false - if(shouldProcessHistoryMsg && !authState.creds.myAppStateKeyId) { + if(historyMsg && !authState.creds.myAppStateKeyId) { logger.warn('skipping app state sync, as myAppStateKeyId is not set') pendingAppStateSync = true } @@ -733,7 +733,7 @@ export const makeChatsSocket = (config: SocketConfig) => { await Promise.all([ (async() => { if( - shouldProcessHistoryMsg + historyMsg && authState.creds.myAppStateKeyId ) { pendingAppStateSync = false