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:
Lauryn Menard
2022-11-18 17:00:42 +01:00
committed by Tim Abbott
parent 6926415c26
commit a67a622adc
2 changed files with 23 additions and 8 deletions

View File

@@ -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();
}
}