fetch_status: Add function to copy current status of msg list data.

This will be used to copy over status of superset data to the
newly populated message list data.
This commit is contained in:
Aman Agrawal 2024-11-01 23:30:45 +05:30 committed by Tim Abbott
parent 1f11650275
commit 662f364283
1 changed files with 11 additions and 0 deletions

View File

@ -141,4 +141,15 @@ export class FetchStatus {
max_id_for_messages(messages),
);
}
copy_status(fetch_status: FetchStatus): void {
this._found_newest = fetch_status.has_found_newest();
this._found_oldest = fetch_status.has_found_oldest();
this._expected_max_message_id = fetch_status._expected_max_message_id;
this._history_limited = fetch_status._history_limited;
// We don't want to copy over the loading state of the message list
// data since the same data object is not used for two messages lists
// and hence when the fetch is finished, only the original message list
// data will be updated.
}
}