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_scroll: Don't mark message read on system animated scroll.

Aman Agrawala1aa52cff4aa
diff --git a/web/src/message_scroll.js b/web/src/message_scroll.js
index ce27601ade7..50267e91831 100644
--- a/web/src/message_scroll.js
+++ b/web/src/message_scroll.js
@@ -87,6 +87,16 @@ export function scroll_finished() {
if (message_scroll_state.update_selection_on_next_scroll) {
message_viewport.keep_pointer_in_view();
+ // If we don't want to update message selection on this scroll,
+ // we also don't want to mark any visible messages as read and
+ // are waiting on user input to do so. So, we only mark messages
+ // as read if we are updating selection on this scroll.
+ //
+ // When the window scrolls, it may cause some messages to
+ // enter the screen and become read. Calling
+ // unread_ops.process_visible will update necessary
+ // data structures and DOM elements.
+ setTimeout(unread_ops.process_visible, 0);
} else {
message_scroll_state.set_update_selection_on_next_scroll(true);
}
@@ -109,12 +119,6 @@ export function scroll_finished() {
msg_list: message_lists.current,
});
}
-
- // When the window scrolls, it may cause some messages to
- // enter the screen and become read. Calling
- // unread_ops.process_visible will update necessary
- // data structures and DOM elements.
- setTimeout(unread_ops.process_visible, 0);
}
let scroll_timer;
@@ -140,7 +144,6 @@ export function initialize() {
return;
}
- unread_ops.process_visible();
message_lists.current.view.update_sticky_recipient_headers();
scroll_finish();
}, 50),