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.

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

Aman Agrawal662f36428312
diff --git a/web/src/fetch_status.ts b/web/src/fetch_status.ts
index f60f4b4c4e6..4ae7298cc77 100644
--- a/web/src/fetch_status.ts
+++ b/web/src/fetch_status.ts
@@ -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.
+ }
}