message_fetch: opts.msg_list can be undefined.

See also 69e10b4dae.

Even though opts.msg_list can be undefined, we still want to retry
loading messages for it since our code needs that data regardless
of opts.msg_list being undefined.
This commit is contained in:
Alex Vandiver
2023-11-01 03:49:09 +00:00
committed by Tim Abbott
parent cd48ee2152
commit 9f0008372c

View File

@@ -326,9 +326,14 @@ export function load_messages(opts, attempt = 1) {
ui_report.hide_error($("#connection-error"));
}
if (opts.msg_list.narrowed && opts.msg_list !== message_lists.current) {
// We unnarrowed before getting an error so don't
// bother trying again or doing further processing.
if (
opts.msg_list !== undefined &&
opts.msg_list !== message_lists.current &&
opts.msg_list.narrowed
) {
// This fetch was for a narrow, and we unnarrowed
// before getting an error, so don't bother trying
// again or doing further processing.
return;
}
if (xhr.status === 400) {