From c67b38fa7da2c67eed28cc274d4a7cbe1ffcc783 Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Wed, 6 Mar 2024 17:42:32 +0530 Subject: [PATCH] message_viewport: Consistently use 'row_to_output' for callback. This callback(initially named 'row_to_id') is part of two different code paths.For one it refers to 'get_row' function local to 'visible_groups' and for other it refers to 'row_to_id' function local to 'visible_messages'(same namings cause a confusion and is also inconsistent). Here I have renamed the callback to 'row_to_output', this is more explanatory and consistent with name '_divisible_divs' uses for the same callback. --- web/src/message_viewport.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/message_viewport.ts b/web/src/message_viewport.ts index 72b145eab5..ce8cb41d68 100644 --- a/web/src/message_viewport.ts +++ b/web/src/message_viewport.ts @@ -185,13 +185,13 @@ function add_to_visible( top_of_feed: number, bottom_of_feed: number, require_fully_visible: boolean, - row_to_id: ($row: HTMLElement) => T, + row_to_output: ($row: HTMLElement) => T, ): void { for (const row of $candidates) { const row_rect = row.getBoundingClientRect(); // Mark very tall messages as read once we've gotten past them if (in_viewport_or_tall(row_rect, top_of_feed, bottom_of_feed, require_fully_visible)) { - visible.push(row_to_id(row)); + visible.push(row_to_output(row)); } else { break; }