Skip to content

Commit

Permalink
msglist [nfc]: Assert fetched when updating end markers
Browse files Browse the repository at this point in the history
This already holds for the existing callers.  Updating end markers
should only happen after the initial fetch.  During the initial fetch,
we have a separate loading indicator and no end markers.

Signed-off-by: Zixuan James Li <[email protected]>
  • Loading branch information
PIG208 committed Dec 10, 2024
1 parent 7045afe commit 779f3ac
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/model/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ mixin _MessageSequence {

/// Update [items] to include markers at start and end as appropriate.
void _updateEndMarkers() {
assert(fetched);
assert(!(haveOldest && fetchingOlder));
final startMarker = switch ((fetchingOlder, haveOldest)) {
(true, _) => const MessageListLoadingItem(MessageListDirection.older),
Expand Down

0 comments on commit 779f3ac

Please sign in to comment.