mirror of https://github.com/zulip/zulip.git
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.
This commit is contained in:
parent
99ea6ae3fc
commit
c67b38fa7d
|
@ -185,13 +185,13 @@ function add_to_visible<T>(
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue