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: Rename bottom_message_visible.

Tim Abbott45f9bd21e55c
diff --git a/web/src/message_scroll.js b/web/src/message_scroll.js
index 040f0ebcc81..efa231c7f74 100644
--- a/web/src/message_scroll.js
+++ b/web/src/message_scroll.js
@@ -14,7 +14,10 @@ import * as unread_ui from "./unread_ui";
let hide_scroll_to_bottom_timer;
export function hide_scroll_to_bottom() {
const $show_scroll_to_bottom_button = $("#scroll-to-bottom-button-container");
- if (message_viewport.bottom_message_visible() || message_lists.current.visibly_empty()) {
+ if (
+ message_viewport.bottom_rendered_message_visible() ||
+ message_lists.current.visibly_empty()
+ ) {
// If last message is visible, just hide the
// scroll to bottom button.
$show_scroll_to_bottom_button.removeClass("show");
@@ -34,7 +37,7 @@ export function hide_scroll_to_bottom() {
}
export function show_scroll_to_bottom_button() {
- if (message_viewport.bottom_message_visible()) {
+ if (message_viewport.bottom_rendered_message_visible()) {
// Only show scroll to bottom button when
// last message is not visible in the
// current scroll position.
diff --git a/web/src/message_viewport.ts b/web/src/message_viewport.ts
index ca5d93b7d75..acd099ea1b7 100644
--- a/web/src/message_viewport.ts
+++ b/web/src/message_viewport.ts
@@ -88,7 +88,7 @@ export function at_bottom(): boolean {
// This differs from at_bottom in that it only requires the bottom message to
// be visible, but you may be able to scroll down further.
-export function bottom_message_visible(): boolean {
+export function bottom_rendered_message_visible(): boolean {
const $last_row = rows.last_visible();
if ($last_row.length) {
const message_bottom = $last_row[0].getBoundingClientRect().bottom;
diff --git a/web/src/unread_ops.js b/web/src/unread_ops.js
index ab637c8091f..2047b741b83 100644
--- a/web/src/unread_ops.js
+++ b/web/src/unread_ops.js
@@ -459,7 +459,7 @@ function process_scrolled_to_bottom() {
export function process_visible() {
if (
viewport_is_visible_and_focused() &&
- message_viewport.bottom_message_visible() &&
+ message_viewport.bottom_rendered_message_visible() &&
message_lists.current.view.is_end_rendered()
) {
process_scrolled_to_bottom();
diff --git a/web/tests/example7.test.js b/web/tests/example7.test.js
index 57b3aca58ec..ac3376ec16b 100644
--- a/web/tests/example7.test.js
+++ b/web/tests/example7.test.js
@@ -100,7 +100,7 @@ run_test("unread_ops", ({override}) => {
$("#message_feed_container").show();
// Make our "test" message appear visible.
- override(message_viewport, "bottom_message_visible", () => true);
+ override(message_viewport, "bottom_rendered_message_visible", () => true);
// Set message_lists.current containing messages that can be marked read
override(message_lists.current, "all_messages", () => test_messages);