message_list: Extract visibly_empty helper method.

This function will allow us to adjust the codebase to write what it
means semantically -- whether a check is for the message list being
visibly empty, or completely empty.

In this commit, we leave the .empty() method incorrect, because
several other adjustments need to be made atomically with fixing it.
This commit is contained in:
Tim Abbott
2023-05-01 19:04:46 -07:00
parent 8f1c3a0fa1
commit 804f473214
13 changed files with 41 additions and 30 deletions

View File

@@ -101,7 +101,7 @@ export function page_down_the_right_amount() {
}
export function page_up() {
if (message_viewport.at_top() && !message_lists.current.empty()) {
if (message_viewport.at_top() && !message_lists.current.visibly_empty()) {
message_lists.current.select_id(message_lists.current.first().id, {then_scroll: false});
} else {
page_up_the_right_amount();
@@ -109,7 +109,7 @@ export function page_up() {
}
export function page_down() {
if (message_viewport.at_bottom() && !message_lists.current.empty()) {
if (message_viewport.at_bottom() && !message_lists.current.visibly_empty()) {
message_lists.current.select_id(message_lists.current.last().id, {then_scroll: false});
unread_ops.process_scrolled_to_bottom();
} else {