When narrowed, we want to load messages older than the oldest message

in the narrowed view, not messages older than the oldest message in
the home view

Tim provided most of the code for this patch

(imported from commit ec0bbfd344cac351f56a456fc560848603721135)
This commit is contained in:
Jeff Arnold 2012-12-03 13:46:51 -05:00
parent 5ea4e30caf
commit f014163aed
1 changed files with 4 additions and 1 deletions

View File

@ -751,12 +751,15 @@ function reset_load_more_status() {
function load_more_messages() {
var batch_size = 400;
var table, oldest_message_id;
if (!load_more_enabled) {
return;
}
ui.show_load_more_messages_spinner();
load_more_enabled = false;
load_old_messages(message_array[0].id, batch_size, 0,
table = narrow.active() ? "zfilt" : "zhome";
oldest_message_id = rows.id(rows.get_table(table).find("tr[zid]:first"));
load_old_messages(oldest_message_id, batch_size, 0,
function (messages) {
ui.hide_load_more_messages_spinner();
if (messages.length === batch_size + 1) {