mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +00:00
navigate: Correct handling of limited fetched content.
This correctly avoids pageup/pagedown scrolling past already rendered
content, while also always making progress, which the previous logic
introduced in d8ec141de2 might do, at
least in degenerate cases with very small render windows.
I'm not sure this change has any effect in practice with current
render window values, but it does fix a bug if I set the maximum
render window size to 20.
This commit is contained in:
@@ -1439,6 +1439,10 @@ export class MessageListView {
|
||||
this.message_containers.clear();
|
||||
}
|
||||
|
||||
last_rendered_message() {
|
||||
return this.list.data._items[this._render_win_end - 1];
|
||||
}
|
||||
|
||||
is_fetched_end_rendered() {
|
||||
return this._render_win_end === this.list.num_items();
|
||||
}
|
||||
@@ -1452,6 +1456,10 @@ export class MessageListView {
|
||||
return this.is_fetched_end_rendered() && this.list.data.fetch_status.has_found_newest();
|
||||
}
|
||||
|
||||
first_rendered_message() {
|
||||
return this.list.data._items[this._render_win_start];
|
||||
}
|
||||
|
||||
is_fetched_start_rendered() {
|
||||
return this._render_win_start === 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user