mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 19:31:58 +00:00
Avoid an unnecessary load_old_messages call on page load.
Previously, our check for whether we needed to call load_old_messages a second time on page load to get up to the present caused us to basically always do such a call. (imported from commit b599041e8c0853b4c8c9ab2def6679142302523e)
This commit is contained in:
@@ -907,8 +907,9 @@ $(function () {
|
||||
}
|
||||
|
||||
// catch the user up
|
||||
if (messages.length !== 1) {
|
||||
if (messages.length !== 0) {
|
||||
var latest_id = messages[messages.length-1].id;
|
||||
if (latest_id < page_params.max_message_id) {
|
||||
load_old_messages({
|
||||
anchor: latest_id,
|
||||
num_before: 0,
|
||||
@@ -918,6 +919,7 @@ $(function () {
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
// now start subscribing to updates
|
||||
get_updates();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user