mirror of https://github.com/zulip/zulip.git
Revert "Disable backfilling 1,000 messages on idle"
Now that Zev's message list branch is merged, there's no longer a performance penalty for loading these old messages, and it improves our narrowing performance to have them loaded. This code is slightly different from the original commit 93d47710891cfc4db9fa00beaa5ccd10113aa1c3 since the way to access the first element in the message list and the API for get_old_messages have changed since then. (imported from commit f295f892bea9327eb8316225b7b98f0e3b3fdc9a)
This commit is contained in:
parent
10b15640e9
commit
c947fbd0e9
|
@ -630,6 +630,14 @@ $(function () {
|
|||
}
|
||||
// now start subscribing to updates
|
||||
get_updates();
|
||||
|
||||
// backfill more messages after the user is idle
|
||||
var backfill_batch_size = 1000;
|
||||
$(document).idle({'idle': 1000*10,
|
||||
'onIdle': function () {
|
||||
var first_id = all_msg_list.first().id;
|
||||
load_old_messages(first_id, backfill_batch_size, 0, home_msg_list);
|
||||
}});
|
||||
}
|
||||
|
||||
if (have_initial_messages) {
|
||||
|
|
Loading…
Reference in New Issue