navigate: Fix buggy detection of start/end.

I was not able to reproduce obviously badly broken behavior from these
logic bugs, but after the renaming of message_viewport helpers in the
last few commits, it's clear that this logic was trying to check if
we're actually at the start/end of the possibly message feed, not just
the rendered portion, and doing so incorrectly.
This commit is contained in:
Tim Abbott
2024-01-31 13:58:28 -08:00
parent 4f8da7462d
commit d8ec141de2
3 changed files with 26 additions and 2 deletions

View File

@@ -1451,6 +1451,15 @@ export class MessageListView {
);
}
is_start_rendered() {
// Used as a helper in checks for whether a given scroll
// position is actually the very start of this view. It could
// fail to be for two reasons: Either some older messages are
// not rendered due to a render window, or we haven't finished
// fetching the oldest messages for this view from the server.
return this._render_win_start === 0 && this.list.data.fetch_status.has_found_oldest();
}
get_row(id) {
const $row = this._rows.get(id);