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: Use first unread anchor for home view.

Tim Abbottf28b38bd8c25
diff --git a/frontend_tests/node_tests/message_fetch.js b/frontend_tests/node_tests/message_fetch.js
index b06f4f1ea1f..f4e62f81aab 100644
--- a/frontend_tests/node_tests/message_fetch.js
+++ b/frontend_tests/node_tests/message_fetch.js
@@ -138,7 +138,7 @@ function message_range(start, end) {
const initialize_data = {
initial_fetch: {
req: {
- anchor: 444,
+ anchor: 'first_unread',
num_before: 200,
num_after: 200,
client_gravatar: true,
diff --git a/static/js/message_fetch.js b/static/js/message_fetch.js
index b2ff38e282f..a296004ed7d 100644
--- a/static/js/message_fetch.js
+++ b/static/js/message_fetch.js
@@ -402,7 +402,9 @@ exports.initialize = function () {
// near: narrow query, we want to select a specific message.
anchor = page_params.initial_pointer;
} else {
- anchor = page_params.pointer;
+ // Otherwise, we should just use the first unread message in
+ // the user's unmuted history as our anchor.
+ anchor = "first_unread";
}
exports.load_messages({
anchor: anchor,