Skip to content

Commit 7eba55f

Browse files
committed
msglist: Softly override mark-read-on-scroll setting in starred/mentions
This isn't so "soft" right now, because we don't offer a way to undo the override -- that's #1655, as the new comment says -- but conceptually this seems correct and seems to match web. We'll do this for search, too, coming up.
1 parent 42d8b32 commit 7eba55f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/widgets/message_list.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ abstract class MessageListPageState {
146146
///
147147
/// For example, this is set to false after pressing
148148
/// "Mark as unread from here" in the message action sheet.
149+
// TODO(#1655) When this is false and
150+
// [GlobalSettingsStore.markReadOnScrollForNarrow] gives true,
151+
// show an alert and a button that lets you exit this temporary state.
149152
bool? get markReadOnScroll;
150153
set markReadOnScroll(bool? value);
151154
}
@@ -235,6 +238,18 @@ class _MessageListPageState extends State<MessageListPage> implements MessageLis
235238
void initState() {
236239
super.initState();
237240
narrow = widget.initNarrow;
241+
242+
switch (narrow) {
243+
case CombinedFeedNarrow():
244+
case ChannelNarrow():
245+
case TopicNarrow():
246+
case DmNarrow():
247+
break;
248+
case MentionsNarrow():
249+
case StarredMessagesNarrow():
250+
// TODO(#1583) write tests for this
251+
_markReadOnScroll = false;
252+
}
238253
}
239254

240255
void _narrowChanged(Narrow newNarrow) {

0 commit comments

Comments
 (0)