From 82ec451a19fc8cb940bd37e6426e22ecb41bfd72 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Tue, 22 Apr 2025 11:06:51 +0530 Subject: [PATCH] topic_list: Rename function to specify where it works. This function only works to scroll topic in left sidebar. --- web/src/stream_list.ts | 2 +- web/src/topic_list.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/stream_list.ts b/web/src/stream_list.ts index f7d690027e..16c32a6b2e 100644 --- a/web/src/stream_list.ts +++ b/web/src/stream_list.ts @@ -782,7 +782,7 @@ export function handle_narrow_activated( } if (is_zoomed_in()) { - topic_list.scroll_zoomed_in_topic_into_view(); + topic_list.left_sidebar_scroll_zoomed_in_topic_into_view(); } } diff --git a/web/src/topic_list.ts b/web/src/topic_list.ts index 1eadb2d481..bce7c289d5 100644 --- a/web/src/topic_list.ts +++ b/web/src/topic_list.ts @@ -328,7 +328,7 @@ export function rebuild_left_sidebar($stream_li: JQuery, stream_id: number): voi active_widgets.set(stream_id, widget); } -export function scroll_zoomed_in_topic_into_view(): void { +export function left_sidebar_scroll_zoomed_in_topic_into_view(): void { const $selected_topic = $(".topic-list .topic-list-item.active-sub-filter"); if ($selected_topic.length === 0) { // If we don't have a selected topic, scroll to top. @@ -377,7 +377,7 @@ export function zoom_in(): void { // It is fine to force scroll here even if user has scrolled to a different // position since we just added some topics to the list which moved user // to a different position anyway. - scroll_zoomed_in_topic_into_view(); + left_sidebar_scroll_zoomed_in_topic_into_view(); } } @@ -385,7 +385,7 @@ export function zoom_in(): void { active_widget.build(spinner); stream_topic_history_util.get_server_history(stream_id, on_success); - scroll_zoomed_in_topic_into_view(); + left_sidebar_scroll_zoomed_in_topic_into_view(); } export function get_left_sidebar_topic_search_term(): string {