refactor: chats.set event

This commit is contained in:
Adhiraj Singh
2022-01-16 13:02:38 +05:30
parent 09553def8a
commit 7bb6e3ceeb
7 changed files with 30 additions and 21 deletions

View File

@@ -192,7 +192,7 @@ const makeChatsSocket = (config: LegacySocketConfig) => {
})
logger.info(`got ${chats.length} chats, extracted ${contacts.length} contacts with name`)
ev.emit('chats.set', { chats, messages: [], contacts })
ev.emit('chats.set', { chats, isLatest: true })
}
})
// got all contacts from phone
@@ -208,7 +208,7 @@ const makeChatsSocket = (config: LegacySocketConfig) => {
})
logger.info(`got ${contacts.length} contacts`)
ev.emit('chats.set', { chats: [], messages: [], contacts })
ev.emit('contacts.set', { contacts })
}
})
// status updates