Skip to content

Commit 29705f0

Browse files
committed
msglist [nfc]: Place _allMessagesVisible right after _messageVisible
This is solely for a better order.
1 parent 5385de4 commit 29705f0

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

lib/model/message_list.dart

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -448,39 +448,39 @@ class MessageListView with ChangeNotifier, _MessageSequence {
448448
}
449449
}
450450

451-
/// Whether this event could affect the result that [_messageVisible]
452-
/// would ever have returned for any possible message in this message list.
453-
VisibilityEffect _canAffectVisibility(UserTopicEvent event) {
451+
/// Whether [_messageVisible] is true for all possible messages.
452+
///
453+
/// This is useful for an optimization.
454+
bool get _allMessagesVisible {
454455
switch (narrow) {
455456
case CombinedFeedNarrow():
456-
return store.willChangeIfTopicVisible(event);
457-
458-
case ChannelNarrow(:final streamId):
459-
if (event.streamId != streamId) return VisibilityEffect.none;
460-
return store.willChangeIfTopicVisibleInStream(event);
457+
case ChannelNarrow():
458+
return false;
461459

462460
case TopicNarrow():
463461
case DmNarrow():
464462
case MentionsNarrow():
465463
case StarredMessagesNarrow():
466-
return VisibilityEffect.none;
464+
return true;
467465
}
468466
}
469467

470-
/// Whether [_messageVisible] is true for all possible messages.
471-
///
472-
/// This is useful for an optimization.
473-
bool get _allMessagesVisible {
468+
/// Whether this event could affect the result that [_messageVisible]
469+
/// would ever have returned for any possible message in this message list.
470+
VisibilityEffect _canAffectVisibility(UserTopicEvent event) {
474471
switch (narrow) {
475472
case CombinedFeedNarrow():
476-
case ChannelNarrow():
477-
return false;
473+
return store.willChangeIfTopicVisible(event);
474+
475+
case ChannelNarrow(:final streamId):
476+
if (event.streamId != streamId) return VisibilityEffect.none;
477+
return store.willChangeIfTopicVisibleInStream(event);
478478

479479
case TopicNarrow():
480480
case DmNarrow():
481481
case MentionsNarrow():
482482
case StarredMessagesNarrow():
483-
return true;
483+
return VisibilityEffect.none;
484484
}
485485
}
486486

0 commit comments

Comments
 (0)