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
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