mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 19:31:58 +00:00
recent-conversations: Check for data change when processing message.
Add in a check to `recent_topics_data.process_message` so that we know if any conversation data was updated and can rerender the based on that information.
This commit is contained in:
committed by
Tim Abbott
parent
6926415c26
commit
a67a622adc
@@ -298,10 +298,17 @@ 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.
|
||||
let conversation_data_updated = false;
|
||||
if (messages.length > 0) {
|
||||
for (const msg of messages) {
|
||||
process_message(msg);
|
||||
if (process_message(msg)) {
|
||||
conversation_data_updated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Only rerender if conversation data actually changed.
|
||||
if (conversation_data_updated) {
|
||||
complete_rerender();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user