mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
Check reason_empty on client when there are no new messages
This fixes a problem where the client would never stop asking for old messages (bug introduced during rebase) (imported from commit eef9f19e1e9982b1e0a954eb36a81e1b7ee5b564)
This commit is contained in:
parent
2374b6e16f
commit
899d5c776f
@ -495,16 +495,6 @@ function add_messages(data) {
|
||||
$('#load_more').show();
|
||||
}
|
||||
|
||||
if (data.messages.length === 0) {
|
||||
if (data.reason_empty === 'no_old_messages') {
|
||||
$('#load_more').hide();
|
||||
|
||||
// Don't ask for more old messages in the future.
|
||||
max_messages_for_backfill = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
$.each(data.messages, add_message_metadata);
|
||||
|
||||
if (data.where === 'top') {
|
||||
@ -663,7 +653,14 @@ function get_updates() {
|
||||
start_reload_app();
|
||||
}
|
||||
|
||||
if (data.messages.length !== 0) {
|
||||
if (data.messages.length === 0) {
|
||||
if (data.reason_empty === 'no_old_messages') {
|
||||
$('#load_more').hide();
|
||||
|
||||
// Don't ask for more old messages in the future.
|
||||
max_messages_for_backfill = 0;
|
||||
}
|
||||
} else {
|
||||
add_messages(data);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user