fix: correctly sync app state

This commit is contained in:
Adhiraj Singh
2022-12-09 10:15:58 +05:30
parent bed4f7f524
commit a5d263d31b

View File

@@ -725,7 +725,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
) )
: false : false
if(shouldProcessHistoryMsg && !authState.creds.myAppStateKeyId) { if(historyMsg && !authState.creds.myAppStateKeyId) {
logger.warn('skipping app state sync, as myAppStateKeyId is not set') logger.warn('skipping app state sync, as myAppStateKeyId is not set')
pendingAppStateSync = true pendingAppStateSync = true
} }
@@ -733,7 +733,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
await Promise.all([ await Promise.all([
(async() => { (async() => {
if( if(
shouldProcessHistoryMsg historyMsg
&& authState.creds.myAppStateKeyId && authState.creds.myAppStateKeyId
) { ) {
pendingAppStateSync = false pendingAppStateSync = false