message-fetch: Update empty narrow check to include opts message list.

In 16c45aa, the check for an empty narrow was updated to no longer
confirm if no messages were returned by the message fetch request.

Updates the empty narrow check to confirm that the messages fetched,
and being processed are for the current / narrow message list before
showing an empty narrow.
This commit is contained in:
Lauryn Menard
2022-11-22 18:09:11 +01:00
committed by Tim Abbott
parent ea14e14862
commit 247958d55c

View File

@@ -54,7 +54,11 @@ function process_result(data, opts) {
message_util.add_old_messages(messages, opts.msg_list);
}
if (message_lists.current === message_list.narrowed && message_list.narrowed.empty()) {
if (
opts.msg_list === message_list.narrowed &&
message_lists.current === message_list.narrowed &&
message_list.narrowed.empty()
) {
// Even after loading more messages, we have
// no messages to display in this narrow.
narrow_banner.show_empty_narrow_message();