mirror of https://github.com/zulip/zulip.git
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:
parent
a8698c08ca
commit
f55ee266b7
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue