Add unread count from actual participant

This commit is contained in:
J Francisco Rader committed 2021-03-10 13:27:11 -05:00
1 parent 7d233a9efa
commit c066e1a464
1 file changed
+5 -1
+5 -1
View File
@@ -243,10 +243,14 @@ async function getConsolidatedMessageGroups(userIdentifier: string): Promise<Mes
mapping[groupId].phoneNumbers = mapping[groupId].phoneNumbers.concat(
messageGroup.phone_number,
);
if (messageGroup.participant_identifier === userIdentifier) {
mapping[groupId].unreadCount = messageGroup.unreadCount;
}
} else {
mapping[groupId] = {
user_identifier: messageGroup.user_identifier,
unreadCount: messageGroup.unreadCount,
unreadCount:
messageGroup.participant_identifier === userIdentifier ? messageGroup.unreadCount : 0,
avatar: messageGroup.avatar,
label: messageGroup.label,
participants: [displayTerm],