mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-26 18:41:10 +00:00
Decrement pending_contact_requests even if a request fails
This commit is contained in:
parent
2aec4ff234
commit
d7cba73ead
1 changed files with 4 additions and 3 deletions
|
@ -322,10 +322,10 @@ impl UserStore {
|
||||||
cx.notify();
|
cx.notify();
|
||||||
|
|
||||||
cx.spawn(|this, mut cx| async move {
|
cx.spawn(|this, mut cx| async move {
|
||||||
let request = client
|
let response = client
|
||||||
.ok_or_else(|| anyhow!("can't upgrade client reference"))?
|
.ok_or_else(|| anyhow!("can't upgrade client reference"))?
|
||||||
.request(request);
|
.request(request)
|
||||||
request.await?;
|
.await;
|
||||||
this.update(&mut cx, |this, cx| {
|
this.update(&mut cx, |this, cx| {
|
||||||
if let Entry::Occupied(mut request_count) =
|
if let Entry::Occupied(mut request_count) =
|
||||||
this.pending_contact_requests.entry(user_id)
|
this.pending_contact_requests.entry(user_id)
|
||||||
|
@ -337,6 +337,7 @@ impl UserStore {
|
||||||
}
|
}
|
||||||
cx.notify();
|
cx.notify();
|
||||||
});
|
});
|
||||||
|
response?;
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue