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.

message_list: Avoid unnecessary rerenders on adding messages.

Aman Agrawala18b7f760d53
diff --git a/web/src/message_list.ts b/web/src/message_list.ts
index b57c46d1106..403b80a301b 100644
--- a/web/src/message_list.ts
+++ b/web/src/message_list.ts
@@ -202,6 +202,11 @@ export class MessageList {
const bottom_messages = info.bottom_messages;
const interior_messages = info.interior_messages;
+ if (top_messages.length + interior_messages.length + bottom_messages.length === 0) {
+ // This add messages call had no effect on the message list.
+ return undefined;
+ }
+
// Currently we only need data back from rendering to
// tell us whether users needs to scroll, which only
// applies for `append_to_view`, but this may change over