Skip to content

Commit 0477164

Browse files
sm-sayedichrisbobbe
authored andcommitted
msglist [nfc]: Place _allMessagesVisible right after _messageVisible
This is solely for a better order.
1 parent 486667f commit 0477164

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
@@ -642,39 +642,39 @@ class MessageListView with ChangeNotifier, _MessageSequence {
642642
}
643643
}
644644

645-
/// Whether this event could affect the result that [_messageVisible]
646-
/// would ever have returned for any possible message in this message list.
647-
VisibilityEffect _canAffectVisibility(UserTopicEvent event) {
645+
/// Whether [_messageVisible] is true for all possible messages.
646+
///
647+
/// This is useful for an optimization.
648+
bool get _allMessagesVisible {
648649
switch (narrow) {
649650
case CombinedFeedNarrow():
650-
return store.willChangeIfTopicVisible(event);
651-
652-
case ChannelNarrow(:final streamId):
653-
if (event.streamId != streamId) return VisibilityEffect.none;
654-
return store.willChangeIfTopicVisibleInStream(event);
651+
case ChannelNarrow():
652+
return false;
655653

656654
case TopicNarrow():
657655
case DmNarrow():
658656
case MentionsNarrow():
659657
case StarredMessagesNarrow():
660-
return VisibilityEffect.none;
658+
return true;
661659
}
662660
}
663661

664-
/// Whether [_messageVisible] is true for all possible messages.
665-
///
666-
/// This is useful for an optimization.
667-
bool get _allMessagesVisible {
662+
/// Whether this event could affect the result that [_messageVisible]
663+
/// would ever have returned for any possible message in this message list.
664+
VisibilityEffect _canAffectVisibility(UserTopicEvent event) {
668665
switch (narrow) {
669666
case CombinedFeedNarrow():
670-
case ChannelNarrow():
671-
return false;
667+
return store.willChangeIfTopicVisible(event);
668+
669+
case ChannelNarrow(:final streamId):
670+
if (event.streamId != streamId) return VisibilityEffect.none;
671+
return store.willChangeIfTopicVisibleInStream(event);
672672

673673
case TopicNarrow():
674674
case DmNarrow():
675675
case MentionsNarrow():
676676
case StarredMessagesNarrow():
677-
return true;
677+
return VisibilityEffect.none;
678678
}
679679
}
680680

0 commit comments

Comments
 (0)