From a44a4342b99010fe350bb524104a4382e89ed0f2 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Sat, 24 Feb 2024 07:13:01 +0000 Subject: [PATCH] message_scroll: Don't process msg scroll events in non-message views. --- web/src/message_scroll.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/message_scroll.js b/web/src/message_scroll.js index 44884885e0..9e5dfdada9 100644 --- a/web/src/message_scroll.js +++ b/web/src/message_scroll.js @@ -133,8 +133,12 @@ export function initialize() { $(document).on( "scroll", _.throttle(() => { + if (message_lists.current === undefined) { + return; + } + unread_ops.process_visible(); - message_lists.current?.view.update_sticky_recipient_headers(); + message_lists.current.view.update_sticky_recipient_headers(); scroll_finish(); }, 50), );