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:
Simon Laux
2022-07-03 19:15:50 +02:00
parent f3a9ab6d23
commit 918ec85767

View File

@@ -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(())
}