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_fetch: Don't re-fetch recent msgs for spectator.

Aman Agrawal9bd2701f5b5e
diff --git a/static/js/message_fetch.js b/static/js/message_fetch.js
index 80aba7e60b2..c2abdcf091e 100644
--- a/static/js/message_fetch.js
+++ b/static/js/message_fetch.js
@@ -447,6 +447,12 @@ export function initialize(home_view_loaded) {
cont: load_more,
});
+ if (page_params.is_spectator) {
+ // Since spectators never have old unreads, we can skip the
+ // hacky fetch below for them (which would just waste resources).
+ return;
+ }
+
// In addition to the algorithm above, which is designed to ensure
// that we fetch all message history eventually starting with the
// first unread message, we also need to ensure that the Recent