Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

message_viewport: Fix TypeScript noUncheckedIndexedAccess errors.

Anders Kaseorgeddf79fca20e
diff --git a/web/src/message_viewport.ts b/web/src/message_viewport.ts
index abf6202a98c..2847981242f 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;