mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
Decrement pending_contact_requests even if a request fails
This commit is contained in:
parent
2aec4ff234
commit
d7cba73ead
@ -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(())
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user