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