mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 03:41: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
|
// catch the user up
|
||||||
if (messages.length !== 1) {
|
if (messages.length !== 0) {
|
||||||
var latest_id = messages[messages.length-1].id;
|
var latest_id = messages[messages.length-1].id;
|
||||||
|
if (latest_id < page_params.max_message_id) {
|
||||||
load_old_messages({
|
load_old_messages({
|
||||||
anchor: latest_id,
|
anchor: latest_id,
|
||||||
num_before: 0,
|
num_before: 0,
|
||||||
@@ -918,6 +919,7 @@ $(function () {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// now start subscribing to updates
|
// now start subscribing to updates
|
||||||
get_updates();
|
get_updates();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user