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.

recent_topics_ui: Adjust filter classes once they are displayed.

Aman Agrawale0f9332280a3
diff --git a/static/js/recent_topics_ui.js b/static/js/recent_topics_ui.js
index 05a7ca6b072..57eb78ccbe6 100644
--- a/static/js/recent_topics_ui.js
+++ b/static/js/recent_topics_ui.js
@@ -783,8 +783,6 @@ export function complete_rerender() {
return;
}
- show_selected_filters();
-
// Show topics list
const mapped_topic_values = Array.from(get().values()).map((value) => value);
@@ -802,6 +800,13 @@ export function complete_rerender() {
is_spectator: page_params.is_spectator,
});
$("#recent_topics_table").html(rendered_body);
+
+ // `show_selected_filters` needs to be called after the Recent
+ // Conversations view has been added to the DOM, to ensure that filters
+ // have the correct classes (checked or not) if Recent Conversations
+ // was not the first view loaded in the app.
+ show_selected_filters();
+
const $container = $("#recent_topics_table table tbody");
$container.empty();
topics_widget = ListWidget.create($container, mapped_topic_values, {