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_view: Fix incompletely updated UI after topic edits.

Aman Agrawal7387d75d5d32
diff --git a/web/src/recent_view_ui.ts b/web/src/recent_view_ui.ts
index 8901d0c9c98..fb563d139af 100644
--- a/web/src/recent_view_ui.ts
+++ b/web/src/recent_view_ui.ts
@@ -814,11 +814,17 @@ export function process_topic_edit(
recent_view_data.conversations.delete(recent_view_util.get_topic_key(old_stream_id, old_topic));
const old_topic_msgs = message_util.get_loaded_messages_in_topic(old_stream_id, old_topic);
- process_messages(old_topic_msgs);
new_stream_id = new_stream_id || old_stream_id;
const new_topic_msgs = message_util.get_loaded_messages_in_topic(new_stream_id, new_topic);
- process_messages(new_topic_msgs);
+
+ for (const msg of [...old_topic_msgs, ...new_topic_msgs]) {
+ recent_view_data.process_message(msg);
+ }
+
+ // It is best to re-render the complete UI instead of
+ // handling all edge cases that can arise due to topic edit.
+ complete_rerender();
}
export function topic_in_search_results(