From eddf79fca20e8cce3b10dd73b0b30aaffcd2b0a0 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 30 May 2024 10:07:59 -0700 Subject: [PATCH] message_viewport: Fix TypeScript noUncheckedIndexedAccess errors. Signed-off-by: Anders Kaseorg --- web/src/message_viewport.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/message_viewport.ts b/web/src/message_viewport.ts index abf6202a98..2847981242 100644 --- a/web/src/message_viewport.ts +++ b/web/src/message_viewport.ts @@ -92,7 +92,7 @@ export function at_rendered_bottom(): boolean { // further to see the rest of that message. export function bottom_rendered_message_visible(): boolean { const $last_row = rows.last_visible(); - if ($last_row.length) { + if ($last_row[0] !== undefined) { const message_bottom = $last_row[0].getBoundingClientRect().bottom; const bottom_of_feed = $("#compose")[0].getBoundingClientRect().top; return bottom_of_feed > message_bottom;