fix(ui): Fix ChannelListTile sendingIndicator isMessageRead calculation.

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2022-07-04 16:41:50 +05:30
committed by xsahil03x
parent e5f77076a9
commit 816746da8a
2 changed files with 20 additions and 4 deletions
@@ -200,6 +200,14 @@ class StreamChannelListTile extends StatelessWidget {
return const Offstage();
}
final memberReadCount = channelState.read.where((it) {
return it.user.id != currentUser.id &&
(it.lastRead.isAfter(lastMessage.createdAt) ||
it.lastRead.isAtSameMomentAs(
lastMessage.createdAt,
));
}).length;
return Padding(
padding: const EdgeInsets.only(right: 4),
child:
@@ -207,9 +215,9 @@ class StreamChannelListTile extends StatelessWidget {
StreamSendingIndicator(
message: lastMessage,
size: channelPreviewTheme.indicatorIconSize,
isMessageRead: channelState
.currentUserRead!.lastRead
.isAfter(lastMessage.createdAt),
isMessageRead: memberReadCount >=
// Subtract one for the current user.
(channel.memberCount ?? 0) - 1,
),
);
},