message_list_view: Ensure render window IDs are integers.

The previous logic threw confusing exceptions if, during
testing/debugging, one picked an odd render window size.
This commit is contained in:
Tim Abbott 2024-02-05 19:21:25 -08:00
parent a8698c08ca
commit f55ee266b7
1 changed files with 1 additions and 1 deletions

View File

@ -1152,7 +1152,7 @@ export class MessageListView {
}
update_render_window(selected_idx, check_for_changed) {
const new_start = Math.max(selected_idx - this._RENDER_WINDOW_SIZE / 2, 0);
const new_start = Math.max(selected_idx - Math.floor(this._RENDER_WINDOW_SIZE / 2), 0);
if (check_for_changed && new_start === this._render_win_start) {
return false;
}