mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
stream_list: Ignore left sidebar scroll until initial fetch is complete.
Since the initial fetch has a lot of messages, it can add many topics to the left sidebar which can move the selected topic out of the view. Note that `has_scrolled` is triggered even for the scrolls not triggered by user since it is not easy to differentiate between the two events. So, it is okay to ignore it initially.
This commit is contained in:
@@ -168,7 +168,7 @@ function process_result(data: MessageFetchResponse, opts: MessageFetchOptions):
|
||||
|
||||
direct_message_group_data.process_loaded_messages(messages);
|
||||
stream_list.update_streams_sidebar();
|
||||
stream_list.maybe_scroll_narrow_into_view();
|
||||
stream_list.maybe_scroll_narrow_into_view(!first_messages_fetch);
|
||||
|
||||
if (
|
||||
message_lists.current !== undefined &&
|
||||
|
||||
@@ -1091,9 +1091,9 @@ export function scroll_stream_into_view($stream_li: JQuery): void {
|
||||
scroll_util.scroll_element_into_container($stream_li, $container, stream_header_height);
|
||||
}
|
||||
|
||||
export function maybe_scroll_narrow_into_view(): void {
|
||||
export function maybe_scroll_narrow_into_view(first_messages_fetch_done: boolean): void {
|
||||
// we don't want to interfere with user scrolling once the page loads
|
||||
if (has_scrolled) {
|
||||
if (has_scrolled && first_messages_fetch_done) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user