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 view: Fix double loading indicator situation.

Ryan Rehman577055fb5426
diff --git a/static/js/message_fetch.js b/static/js/message_fetch.js
index dc88fcd8a46..0050bdd710c 100644
--- a/static/js/message_fetch.js
+++ b/static/js/message_fetch.js
@@ -174,7 +174,7 @@ exports.load_messages = function (opts) {
data.narrow = JSON.stringify(page_params.narrow);
}
- const update_loading_indicator = opts.msg_list === current_msg_list;
+ let update_loading_indicator = opts.msg_list === current_msg_list;
if (opts.num_before > 0) {
opts.msg_list.data.fetch_status.start_older_batch({
update_loading_indicator: update_loading_indicator,
@@ -187,6 +187,8 @@ exports.load_messages = function (opts) {
}
if (opts.num_after > 0) {
+ // We hide the bottom loading indicator when we're fetching both top and bottom messages.
+ update_loading_indicator = update_loading_indicator && opts.num_before === 0;
opts.msg_list.data.fetch_status.start_newer_batch({
update_loading_indicator: update_loading_indicator,
});
@@ -243,10 +245,7 @@ exports.load_messages_for_narrow = function (opts) {
num_before: consts.narrow_before,
num_after: consts.narrow_after,
msg_list: msg_list,
- cont: function () {
- message_scroll.hide_indicators();
- opts.cont();
- },
+ cont: opts.cont,
});
};