topic list: Don't include muted topics in "more topics" count.

This is for consistency with how we show unreads in muted topics at
the stream level, avoiding distracting users with the appearance of
unread messages in muted topics that they've made clear they are not
interested in.

Arguably, we should show a faded count if there are unreads on muted
topics (but none on unmuted topics), but that seems somewhat complex
to maintain, and we'd benefit from user feedback to make an effective
decision on whether it'd be an improvement.

Fixes #13676.
This commit is contained in:
Tim Abbott 2020-01-15 13:36:43 -08:00
parent 6f4f6fde79
commit 37b563b82f
1 changed files with 5 additions and 1 deletions

View File

@ -112,7 +112,7 @@ exports.widget = function (parent_elem, my_stream_id) {
// after the first several topics with unread messages.
if (!is_active_topic && (topics_selected >= max_topics_with_unread ||
muting.is_topic_muted(my_stream_id, topic_name))) {
if (num_unread > 0) {
if (num_unread > 0 && !muting.is_topic_muted(my_stream_id, topic_name)) {
more_topics_unreads += num_unread;
}
return;
@ -232,6 +232,10 @@ exports.widget = function (parent_elem, my_stream_id) {
// topics"; We need to update the "more topics" count
// instead in that case; we do this by returning true to
// notify the caller to accumulate these.
if (muting.is_topic_muted(my_stream_id, topic)) {
// But we don't count unreads in muted topics.
return false;
}
return true;
}