fix(ui): Fix ChannelListTile sendingIndicator isMessageRead calculation.
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
## Upcoming
|
||||||
|
|
||||||
|
🐞 Fixed
|
||||||
|
|
||||||
|
- [[#1234]](https://github.com/GetStream/stream-chat-flutter/issues/1234) Fix `ChannelListTile`
|
||||||
|
sendingIndicator `isMessageRead` calculation.
|
||||||
|
|
||||||
## 4.3.0
|
## 4.3.0
|
||||||
|
|
||||||
- Updated `photo_view` dependency to [`0.14.0`](https://pub.dev/packages/photo_view/changelog).
|
- Updated `photo_view` dependency to [`0.14.0`](https://pub.dev/packages/photo_view/changelog).
|
||||||
@@ -9,7 +16,8 @@
|
|||||||
- [[#996]](https://github.com/GetStream/stream-chat-flutter/issues/996) Videos break bottom photo
|
- [[#996]](https://github.com/GetStream/stream-chat-flutter/issues/996) Videos break bottom photo
|
||||||
carousal.
|
carousal.
|
||||||
- Fix: URLs with path and/or query params are not enriched.
|
- Fix: URLs with path and/or query params are not enriched.
|
||||||
- [[#1194]](https://github.com/GetStream/stream-chat-flutter/issues/1194) Request permission to access gallery when opening the file picker.
|
- [[#1194]](https://github.com/GetStream/stream-chat-flutter/issues/1194) Request permission to
|
||||||
|
access gallery when opening the file picker.
|
||||||
|
|
||||||
✅ Added
|
✅ Added
|
||||||
|
|
||||||
|
|||||||
+11
-3
@@ -200,6 +200,14 @@ class StreamChannelListTile extends StatelessWidget {
|
|||||||
return const Offstage();
|
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(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(right: 4),
|
padding: const EdgeInsets.only(right: 4),
|
||||||
child:
|
child:
|
||||||
@@ -207,9 +215,9 @@ class StreamChannelListTile extends StatelessWidget {
|
|||||||
StreamSendingIndicator(
|
StreamSendingIndicator(
|
||||||
message: lastMessage,
|
message: lastMessage,
|
||||||
size: channelPreviewTheme.indicatorIconSize,
|
size: channelPreviewTheme.indicatorIconSize,
|
||||||
isMessageRead: channelState
|
isMessageRead: memberReadCount >=
|
||||||
.currentUserRead!.lastRead
|
// Subtract one for the current user.
|
||||||
.isAfter(lastMessage.createdAt),
|
(channel.memberCount ?? 0) - 1,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user