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-conversations: Update logic for processing messages.

Lauryn Menard79c0d7fbabc0
diff --git a/static/js/recent_topics_data.js b/static/js/recent_topics_data.js
index b8e868876ce..ccc21a192ce 100644
--- a/static/js/recent_topics_data.js
+++ b/static/js/recent_topics_data.js
@@ -4,9 +4,6 @@ import {get_key_from_message} from "./recent_topics_util";
export const topics = new Map(); // Key is stream-id:topic.
export function process_message(msg) {
- // This function returns if topic_data
- // has changed or not.
-
// Initialize topic and pm data
// Key for private message is the user id's
// to whom the message is begin sent.
@@ -34,7 +31,6 @@ export function process_message(msg) {
// message fetched in the topic. Ideally we would want this to be attached
// to topic info fetched from backend, which is currently not a thing.
topic_data.participated = is_ours || topic_data.participated;
- return true;
}
function get_sorted_topics() {
diff --git a/static/js/recent_topics_ui.js b/static/js/recent_topics_ui.js
index ee3ae55db1c..e26c142a6f3 100644
--- a/static/js/recent_topics_ui.js
+++ b/static/js/recent_topics_ui.js
@@ -298,17 +298,10 @@ export function process_messages(messages) {
// the UX can be bad if user wants to scroll down the list as
// the UI will be returned to the beginning of the list on every
// update.
- //
- // Only rerender if topic_data actually
- // changed.
- let topic_data_changed = false;
- for (const msg of messages) {
- if (process_message(msg)) {
- topic_data_changed = true;
+ if (messages.length > 0) {
+ for (const msg of messages) {
+ process_message(msg);
}
- }
-
- if (topic_data_changed) {
complete_rerender();
}
}