From 9e3248d4c9132cb52ec8e590185d444100b4675f Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Fri, 18 Dec 2020 17:13:55 +0530 Subject: [PATCH] minor refactor Signed-off-by: Sahil Kumar --- lib/src/message_list_view.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/src/message_list_view.dart b/lib/src/message_list_view.dart index 56d246bf..b56add20 100644 --- a/lib/src/message_list_view.dart +++ b/lib/src/message_list_view.dart @@ -655,9 +655,10 @@ class _MessageListViewState extends State { 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;