mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
restore same configure behaviour as desktop:
make configure restart io with the old configuration if it had one on error
This commit is contained in:
@@ -208,7 +208,13 @@ impl CommandApi {
|
|||||||
async fn configure(&self, account_id: u32) -> Result<()> {
|
async fn configure(&self, account_id: u32) -> Result<()> {
|
||||||
let ctx = self.get_context(account_id).await?;
|
let ctx = self.get_context(account_id).await?;
|
||||||
ctx.stop_io().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;
|
ctx.start_io().await;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user