Skip to content

Commit 037fc72

Browse files
committed
msglist [nfc]: Simplify fetch-older check to extentAfter
This is a more readable way of expressing the exact same thing.
1 parent 6e10fde commit 037fc72

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/widgets/message_list.dart

+1-2
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
218218
_scrollToBottomVisibleValue.value = true;
219219
}
220220

221-
final extentRemainingAboveViewport = scrollMetrics.maxScrollExtent - scrollMetrics.pixels;
222-
if (extentRemainingAboveViewport < kFetchMessagesBufferPixels) {
221+
if (scrollMetrics.extentAfter < kFetchMessagesBufferPixels) {
223222
// TODO: This ends up firing a second time shortly after we fetch a batch.
224223
// The result is that each time we decide to fetch a batch, we end up
225224
// fetching two batches in quick succession. This is basically harmless

0 commit comments

Comments
 (0)