fix: only sync app state on one batch of history

This commit is contained in:
Adhiraj Singh
2022-03-07 18:18:21 +05:30
parent 93262b38f4
commit e93e6e2656

View File

@@ -157,6 +157,10 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
ev.emit('contacts.set', { contacts })
}
if(isLatest) {
resyncMainAppState()
}
break
case proto.ProtocolMessage.ProtocolMessageType.APP_STATE_SYNC_KEY_SHARE:
const keys = protocolMsg.appStateSyncKeyShare!.keys
@@ -172,8 +176,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
}
ev.emit('creds.update', { myAppStateKeyId: newAppStateSyncKeyId })
resyncMainAppState()
} else {
logger.info({ protocolMsg }, 'recv app state sync with 0 keys')
}