mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user