Decrement pending_contact_requests even if a request fails

This commit is contained in:
Max Brunsfeld 2022-05-09 16:19:00 -07:00
parent 2aec4ff234
commit d7cba73ead

View File

@ -322,10 +322,10 @@ impl UserStore {
cx.notify();
cx.spawn(|this, mut cx| async move {
let request = client
let response = client
.ok_or_else(|| anyhow!("can't upgrade client reference"))?
.request(request);
request.await?;
.request(request)
.await;
this.update(&mut cx, |this, cx| {
if let Entry::Occupied(mut request_count) =
this.pending_contact_requests.entry(user_id)
@ -337,6 +337,7 @@ impl UserStore {
}
cx.notify();
});
response?;
Ok(())
})
}