mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
When a narrow would have no messages and just be grey, show a notice instead.
(imported from commit 2b2b653805cb1ebdb545f83b20c01f1d6cbde9b7)
This commit is contained in:
@@ -574,6 +574,13 @@ function add_messages(messages, msg_list, opts) {
|
||||
prepended = true;
|
||||
}
|
||||
|
||||
if ((msg_list === narrowed_msg_list) && !msg_list.empty()) {
|
||||
// If adding some new messages to the message tables caused
|
||||
// our current narrow to no longer be empty, hide the empty
|
||||
// feed placeholder text.
|
||||
util.hide_empty_narrow_message();
|
||||
}
|
||||
|
||||
if (msg_list === all_msg_list && opts.update_unread_counts) {
|
||||
process_unread_counts(messages, false);
|
||||
}
|
||||
@@ -711,6 +718,13 @@ function load_old_messages(anchor, num_before, num_after, msg_list, cont, for_na
|
||||
function process_result(messages) {
|
||||
$('#connection-error').hide();
|
||||
|
||||
if ((messages.length === 0) && (current_msg_list === narrowed_msg_list) &&
|
||||
narrowed_msg_list.empty()) {
|
||||
// Even after trying to load more messages, we have no
|
||||
// messages to display in this narrow.
|
||||
util.show_empty_narrow_message();
|
||||
}
|
||||
|
||||
if (messages.length !== 0 && !cont_will_add_messages) {
|
||||
add_messages(messages, msg_list);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user