message_fetch: Use first unread anchor for home view.

This fixes one of our oldest important user experience issues, namely
that if you never visit the home view, the Zulip webapp would often
load "deep in the past" because the pointer had not advanced.

Fixes #1529.
This commit is contained in:
Tim Abbott 2020-02-19 13:53:08 -08:00
parent 77bbbf7ae0
commit f28b38bd8c
2 changed files with 4 additions and 2 deletions

View File

@ -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,

View File

@ -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,