Hide the 'load more' button sooner if there are no more messages to load

(imported from commit ac046851c3a74a6f053e5f3c3b2950526a49cc46)
This commit is contained in:
Zev Benjamin
2012-11-06 13:17:38 -05:00
parent 39db8bf5d5
commit c21a255b37

View File

@@ -632,9 +632,10 @@ function restart_get_updates() {
}
function load_more_messages() {
load_old_messages(message_array[0].id - 1, "older", 400,
var batch_size = 400;
load_old_messages(message_array[0].id - 1, "older", batch_size,
function (messages) {
if (messages.length === 0) {
if (messages.length !== batch_size) {
$('#load_more').hide();
}
});