Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

topic_list: Update the order of "Followed" topics in the muted stream.

Prakhar Pratyush20886b80d958
diff --git a/web/src/topic_list_data.js b/web/src/topic_list_data.js
index 30750136b2a..9efa1a927e9 100644
--- a/web/src/topic_list_data.js
+++ b/web/src/topic_list_data.js
@@ -128,13 +128,13 @@ export function get_list_info(stream_id, zoomed, search_term) {
}
if (stream_muted && !zoomed) {
- const unmuted_topics = topic_names.filter((topic) =>
- user_topics.is_topic_unmuted(stream_id, topic),
+ const unmuted_or_followed_topics = topic_names.filter((topic) =>
+ user_topics.is_topic_unmuted_or_followed(stream_id, topic),
);
- choose_topics(stream_id, unmuted_topics, zoomed, topic_choice_state);
+ choose_topics(stream_id, unmuted_or_followed_topics, zoomed, topic_choice_state);
const other_topics = topic_names.filter(
- (topic) => !user_topics.is_topic_unmuted(stream_id, topic),
+ (topic) => !user_topics.is_topic_unmuted_or_followed(stream_id, topic),
);
choose_topics(stream_id, other_topics, zoomed, topic_choice_state);
} else {
diff --git a/web/tests/topic_list_data.test.js b/web/tests/topic_list_data.test.js
index 17d34ab2fe2..909b68c8e30 100644
--- a/web/tests/topic_list_data.test.js
+++ b/web/tests/topic_list_data.test.js
@@ -265,7 +265,7 @@ test("get_list_info unreads", ({override}) => {
// this should make topic 5 at top in items array
general.is_muted = true;
add_unreads("topic 5", 1);
- override(user_topics, "is_topic_unmuted", (stream_id, topic_name) => {
+ override(user_topics, "is_topic_unmuted_or_followed", (stream_id, topic_name) => {
assert.equal(stream_id, general.stream_id);
return topic_name === "topic 5";
});