Skip to content

Commit 6a121b8

Browse files
committed
fix: do not emit progress 1000 when configuration is cancelled
There is already code below that emits progress 0 or 1000 depending on whether configuration succeeded or failed. Before this change cancelling resulted in progress 0 emitted, immediately followed by progress 1000.
1 parent 420c0ed commit 6a121b8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/configure.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ mod auto_mozilla;
1313
mod auto_outlook;
1414
pub(crate) mod server_params;
1515

16-
use anyhow::{bail, ensure, Context as _, Result};
16+
use anyhow::{bail, ensure, format_err, Context as _, Result};
1717
use auto_mozilla::moz_autoconfigure;
1818
use auto_outlook::outlk_autodiscover;
1919
use deltachat_contact_tools::EmailAddress;
@@ -80,10 +80,7 @@ impl Context {
8080

8181
let res = self
8282
.inner_configure()
83-
.race(cancel_channel.recv().map(|_| {
84-
progress!(self, 0);
85-
Ok(())
86-
}))
83+
.race(cancel_channel.recv().map(|_| Err(format_err!("Cancelled"))))
8784
.await;
8885

8986
self.free_ongoing().await;

0 commit comments

Comments
 (0)