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.

recent_view: Fetch significant message history per `Load more` click.

Aman Agrawal864a2a067e10
diff --git a/web/src/message_fetch.ts b/web/src/message_fetch.ts
index 69018596811..211900c0415 100644
--- a/web/src/message_fetch.ts
+++ b/web/src/message_fetch.ts
@@ -98,6 +98,7 @@ const consts = {
// Parameters for asking for more history in the recent view.
recent_view_fetch_more_batch_size: 2000,
recent_view_minimum_load_more_fetch_size: 50000,
+ recent_view_load_more_increment_per_click: 25000,
};
export function load_messages_around_anchor(
@@ -565,9 +566,11 @@ export function maybe_load_older_messages(opts: {
}
if (fetched_substantial_history && found_first_unread) {
- // Once we have fetched enough history, we just do fetches in
- // `consts.recent_view_fetch_more_batch_size`.
+ // Increase bar for `fetched_substantial_history` for next
+ // `Load more` click.
opts.cont = () => {
+ consts.recent_view_minimum_load_more_fetch_size +=
+ consts.recent_view_load_more_increment_per_click;
recent_view_ui.set_backfill_in_progress(false);
};
} else {