message_viewport: Fix TypeScript noUncheckedIndexedAccess errors.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-05-30 10:07:59 -07:00
parent ad763ee7a7
commit eddf79fca2
1 changed files with 1 additions and 1 deletions

View File

@ -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;