Call update_device_chats automatically during configure (#1957)

update_device_chats() takes about 2 seconds on a modern device (Android) because the
welcome image file has to be written to the disk as a blob. The problem
was that this was done after the progress bar had vanished and before
anything else happened so that I thought that something had gone wrong
multiple times.

The UIs have to remove update_device_chats(), too..
This commit is contained in:
Hocuri
2020-10-15 17:43:22 +02:00
committed by GitHub
parent 18e9073bfe
commit 07e4762f71
10 changed files with 24 additions and 44 deletions

View File

@@ -163,6 +163,9 @@ async fn configure(ctx: &Context, param: &mut LoginParam) -> Result<()> {
DC_LP_AUTH_NORMAL as i32
};
let ctx2 = ctx.clone();
let update_device_chats_handle = task::spawn(async move { ctx2.update_device_chats().await });
// Step 1: Load the parameters and check email-address and password
if oauth2 {
@@ -357,6 +360,7 @@ async fn configure(ctx: &Context, param: &mut LoginParam) -> Result<()> {
.await;
progress!(ctx, 940);
update_device_chats_handle.await?;
Ok(())
}