mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
recent_view: Fetch significant message history per Load more click.
Increase required messages significantly before stopping the backfill every time `Load more` is clicked.
This commit is contained in:
@@ -98,6 +98,7 @@ const consts = {
|
|||||||
// Parameters for asking for more history in the recent view.
|
// Parameters for asking for more history in the recent view.
|
||||||
recent_view_fetch_more_batch_size: 2000,
|
recent_view_fetch_more_batch_size: 2000,
|
||||||
recent_view_minimum_load_more_fetch_size: 50000,
|
recent_view_minimum_load_more_fetch_size: 50000,
|
||||||
|
recent_view_load_more_increment_per_click: 25000,
|
||||||
};
|
};
|
||||||
|
|
||||||
export function load_messages_around_anchor(
|
export function load_messages_around_anchor(
|
||||||
@@ -565,9 +566,11 @@ export function maybe_load_older_messages(opts: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fetched_substantial_history && found_first_unread) {
|
if (fetched_substantial_history && found_first_unread) {
|
||||||
// Once we have fetched enough history, we just do fetches in
|
// Increase bar for `fetched_substantial_history` for next
|
||||||
// `consts.recent_view_fetch_more_batch_size`.
|
// `Load more` click.
|
||||||
opts.cont = () => {
|
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);
|
recent_view_ui.set_backfill_in_progress(false);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user