Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

message_list_view: Ensure render window IDs are integers.

Tim Abbottf55ee266b79f
diff --git a/web/src/message_list_view.js b/web/src/message_list_view.js
index daafe1b9c0e..09b2f1af51e 100644
--- a/web/src/message_list_view.js
+++ b/web/src/message_list_view.js
@@ -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;
}