From 918ec85767eee7b707ca5533ff75e55056d774a7 Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Sun, 3 Jul 2022 19:15:50 +0200 Subject: [PATCH] restore same configure behaviour as desktop: make configure restart io with the old configuration if it had one on error --- deltachat-jsonrpc/src/api/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/deltachat-jsonrpc/src/api/mod.rs b/deltachat-jsonrpc/src/api/mod.rs index dba3ce9da..7ad7c2aab 100644 --- a/deltachat-jsonrpc/src/api/mod.rs +++ b/deltachat-jsonrpc/src/api/mod.rs @@ -208,7 +208,13 @@ impl CommandApi { async fn configure(&self, account_id: u32) -> Result<()> { let ctx = self.get_context(account_id).await?; ctx.stop_io().await; - ctx.configure().await?; + let result = ctx.configure().await; + if result.is_err() { + if let Ok(true) = ctx.is_configured().await { + ctx.start_io().await; + } + return result; + } ctx.start_io().await; Ok(()) }