message_view: Update date on sticky header after rendering narrow.

On a fresh render of a narrow if the view doesn't scroll,
`update_sticky_recipient_headers` is not called. So, we need call
it after we have scrolled to the message we want to select.
This commit is contained in:
Aman Agrawal 2024-10-02 10:28:01 +00:00 committed by Tim Abbott
parent 69c1b7c64e
commit 787a37176d
2 changed files with 3 additions and 0 deletions

View File

@ -1129,6 +1129,7 @@ export function render_message_list_with_selected_message(opts: {
// narrowing // narrowing
message_lists.current.view.set_message_offset(select_offset); message_lists.current.view.set_message_offset(select_offset);
} }
message_lists.current.view.update_sticky_recipient_headers();
unread_ops.process_visible(); unread_ops.process_visible();
narrow_history.save_narrow_state_and_flush(); narrow_history.save_narrow_state_and_flush();
} }

View File

@ -31,6 +31,7 @@ const message_lists = mock_esm("../src/message_lists", {
removeClass: noop, removeClass: noop,
addClass: noop, addClass: noop,
}, },
update_sticky_recipient_headers: noop,
}, },
data: { data: {
filter: new Filter([{operator: "in", operand: "all"}]), filter: new Filter([{operator: "in", operand: "all"}]),
@ -141,6 +142,7 @@ function stub_message_list() {
removeClass: noop, removeClass: noop,
addClass: noop, addClass: noop,
}, },
update_sticky_recipient_headers: noop,
}; };
get(msg_id) { get(msg_id) {