From 787a37176dc0e8b16097bdf852b6ec481185787d Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Wed, 2 Oct 2024 10:28:01 +0000 Subject: [PATCH] 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. --- web/src/message_view.ts | 1 + web/tests/narrow_activate.test.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/web/src/message_view.ts b/web/src/message_view.ts index c5946a29f9..09b0b0b97d 100644 --- a/web/src/message_view.ts +++ b/web/src/message_view.ts @@ -1129,6 +1129,7 @@ export function render_message_list_with_selected_message(opts: { // narrowing message_lists.current.view.set_message_offset(select_offset); } + message_lists.current.view.update_sticky_recipient_headers(); unread_ops.process_visible(); narrow_history.save_narrow_state_and_flush(); } diff --git a/web/tests/narrow_activate.test.js b/web/tests/narrow_activate.test.js index 1149b11c2e..ac56292c43 100644 --- a/web/tests/narrow_activate.test.js +++ b/web/tests/narrow_activate.test.js @@ -31,6 +31,7 @@ const message_lists = mock_esm("../src/message_lists", { removeClass: noop, addClass: noop, }, + update_sticky_recipient_headers: noop, }, data: { filter: new Filter([{operator: "in", operand: "all"}]), @@ -141,6 +142,7 @@ function stub_message_list() { removeClass: noop, addClass: noop, }, + update_sticky_recipient_headers: noop, }; get(msg_id) {