Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
topic_list: Fix "show all topics" flashing.
Prakhar Pratyush8e1f0c4bcf49
diff --git a/web/src/topic_list.ts b/web/src/topic_list.tsindex bbb310aec5b..188e8d20105 100644--- a/web/src/topic_list.ts+++ b/web/src/topic_list.ts@@ -213,12 +213,11 @@ export function is_full_topic_history_available(update_widget_for_stream(stream_id);}});- // We return `false` which leads to visible 'show all topics',- // even if all the topics are already displayed.- // This is helpful if the API call fails, users will have- // the option to make another request. Otherwise there's- // a possibility of missing 'show all topics' & not all topics displayed.- return false;+ // We return `true` which can possibly lead to missing+ // 'show all topics', even if all the topics are not displayed.+ // The `get_server_history` call above takes care of fetching+ // channel history and rebuilding topic list if needed.+ return true;}const sub = sub_store.get(stream_id);diff --git a/web/tests/topic_list.test.cjs b/web/tests/topic_list.test.cjsindex ce9a84628d5..0396e056b85 100644--- a/web/tests/topic_list.test.cjs+++ b/web/tests/topic_list.test.cjs@@ -74,6 +74,6 @@ test("is_full_topic_history_available", ({override}) => {assert.equal(stream_id, general.stream_id);full_topic_history_fetched_and_widget_updated = true;};- assert.equal(topic_list.is_full_topic_history_available(stream_id), false);+ assert.equal(topic_list.is_full_topic_history_available(stream_id), true);assert.equal(full_topic_history_fetched_and_widget_updated, true);});