Skip to content

Commit

Permalink
msglist [nfc]: Return early if generation has changed
Browse files Browse the repository at this point in the history
Signed-off-by: Zixuan James Li <[email protected]>
  • Loading branch information
PIG208 committed Nov 12, 2024
1 parent e9a8dd6 commit 67fbf9e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/model/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,13 @@ class MessageListView with ChangeNotifier, _MessageSequence {
_insertAllMessages(0, fetchedMessages);
_haveOldest = result.foundOldest;
} finally {
if (this.generation == generation) {
_fetchingOlder = false;
_updateEndMarkers();
notifyListeners();
if (this.generation != generation) {
// ignore: control_flow_in_finally
return;
}
_fetchingOlder = false;
_updateEndMarkers();
notifyListeners();
}
}

Expand Down

0 comments on commit 67fbf9e

Please sign in to comment.