Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

message_fetch: opts.msg_list can be undefined.

Alex Vandiver9f0008372c66
diff --git a/web/src/message_fetch.js b/web/src/message_fetch.js
index 211b3196de0..cc4714adab8 100644
--- a/web/src/message_fetch.js
+++ b/web/src/message_fetch.js
@@ -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) {