From c6d855084e720cbe28dca9df9235ea26a234d23b Mon Sep 17 00:00:00 2001 From: Hocuri Date: Sun, 16 Jan 2022 20:37:28 +0100 Subject: [PATCH] Save "configured" flag later (#2974) While experimenting with encrypted storage, once configuring failed between 920 and 940. But as the "configured" config had already been written after progress 910, some part of the code thought we are configured, some didn't. --- src/configure.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/configure.rs b/src/configure.rs index b726caf00..4d86997e7 100644 --- a/src/configure.rs +++ b/src/configure.rs @@ -454,11 +454,8 @@ async fn configure(ctx: &Context, param: &mut LoginParam) -> Result<()> { drop(imap); progress!(ctx, 910); - // configuration success - write back the configured parameters with the - // "configured_" prefix; also write the "configured"-flag */ // the trailing underscore is correct param.save_to_database(ctx, "configured_").await?; - ctx.sql.set_raw_config_bool("configured", true).await?; ctx.set_config(Config::ConfiguredTimestamp, Some(&time().to_string())) .await?; @@ -476,6 +473,8 @@ async fn configure(ctx: &Context, param: &mut LoginParam) -> Result<()> { progress!(ctx, 940); update_device_chats_handle.await?; + ctx.sql.set_raw_config_bool("configured", true).await?; + Ok(()) }