minor refactor

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2020-12-18 17:13:55 +05:30
parent 99b02623fa
commit 9e3248d4c9
+4 -3
View File
@@ -655,9 +655,10 @@ class _MessageListViewState extends State<MessageListView> {
onVisibilityChanged: (visibility) {
final isVisible = visibility.visibleBounds != Rect.zero;
if (isVisible && !_bottomWasVisible) {
if (streamChannel.channel.state.isUpToDate &&
streamChannel.channel.config?.readEvents == true &&
streamChannel.channel.state.unreadCount > 0) {
final channel = streamChannel.channel;
if (_upToDate &&
channel.config?.readEvents == true &&
channel.state.unreadCount > 0) {
streamChannel.channel.markRead();
}
_bottomWasVisible = !isVisible;