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: Pass msg_list to load_messages_for_narrow.

Tim Abbott5f4faaf22c78
diff --git a/frontend_tests/node_tests/narrow_activate.js b/frontend_tests/node_tests/narrow_activate.js
index 7e49ce09e32..49d936b4421 100644
--- a/frontend_tests/node_tests/narrow_activate.js
+++ b/frontend_tests/node_tests/narrow_activate.js
@@ -169,10 +169,12 @@ run_test("basics", () => {
let cont;
message_fetch.load_messages_for_narrow = (opts) => {
+ // Only validates the anchor and set of fields
cont = opts.cont;
assert.deepEqual(opts, {
cont: opts.cont,
+ msg_list: opts.msg_list,
anchor: 1000,
});
};
diff --git a/static/js/message_fetch.js b/static/js/message_fetch.js
index d64a1507d14..70db6fe8395 100644
--- a/static/js/message_fetch.js
+++ b/static/js/message_fetch.js
@@ -292,13 +292,11 @@ export function load_messages(opts, attempt = 1) {
}
export function load_messages_for_narrow(opts) {
- const msg_list = message_list.narrowed;
-
load_messages({
anchor: opts.anchor,
num_before: consts.narrow_before,
num_after: consts.narrow_after,
- msg_list,
+ msg_list: opts.msg_list,
cont: opts.cont,
});
}
diff --git a/static/js/narrow.js b/static/js/narrow.js
index 17968af29b1..46c9a5dfc59 100644
--- a/static/js/narrow.js
+++ b/static/js/narrow.js
@@ -534,6 +534,7 @@ export function activate(raw_operators, opts) {
msg_list.network_time = new Date();
maybe_report_narrow_time(msg_list);
},
+ msg_list,
});
}