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:
Tim Abbott 2013-03-12 17:16:37 -04:00
parent 10b15640e9
commit c947fbd0e9
1 changed files with 8 additions and 0 deletions

View File

@ -630,6 +630,14 @@ $(function () {
} }
// now start subscribing to updates // now start subscribing to updates
get_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) { if (have_initial_messages) {