Skip to content

Commit 06937e2

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

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
@@ -521,39 +521,39 @@ class MessageListView with ChangeNotifier, _MessageSequence {
521521
}
522522
}
523523

524-
/// Whether this event could affect the result that [_messageVisible]
525-
/// would ever have returned for any possible message in this message list.
526-
VisibilityEffect _canAffectVisibility(UserTopicEvent event) {
524+
/// Whether [_messageVisible] is true for all possible messages.
525+
///
526+
/// This is useful for an optimization.
527+
bool get _allMessagesVisible {
527528
switch (narrow) {
528529
case CombinedFeedNarrow():
529-
return store.willChangeIfTopicVisible(event);
530-
531-
case ChannelNarrow(:final streamId):
532-
if (event.streamId != streamId) return VisibilityEffect.none;
533-
return store.willChangeIfTopicVisibleInStream(event);
530+
case ChannelNarrow():
531+
return false;
534532

535533
case TopicNarrow():
536534
case DmNarrow():
537535
case MentionsNarrow():
538536
case StarredMessagesNarrow():
539-
return VisibilityEffect.none;
537+
return true;
540538
}
541539
}
542540

543-
/// Whether [_messageVisible] is true for all possible messages.
544-
///
545-
/// This is useful for an optimization.
546-
bool get _allMessagesVisible {
541+
/// Whether this event could affect the result that [_messageVisible]
542+
/// would ever have returned for any possible message in this message list.
543+
VisibilityEffect _canAffectVisibility(UserTopicEvent event) {
547544
switch (narrow) {
548545
case CombinedFeedNarrow():
549-
case ChannelNarrow():
550-
return false;
546+
return store.willChangeIfTopicVisible(event);
547+
548+
case ChannelNarrow(:final streamId):
549+
if (event.streamId != streamId) return VisibilityEffect.none;
550+
return store.willChangeIfTopicVisibleInStream(event);
551551

552552
case TopicNarrow():
553553
case DmNarrow():
554554
case MentionsNarrow():
555555
case StarredMessagesNarrow():
556-
return true;
556+
return VisibilityEffect.none;
557557
}
558558
}
559559

0 commit comments

Comments
 (0)