mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-28 01:07:09 +00:00
Merge pull request #2437 from zed-industries/fix-joining-call
Fix "IncomingCallNotification was dropped" error when accepting a call
This commit is contained in:
commit
3f037e5128
1 changed files with 20 additions and 18 deletions
|
@ -78,11 +78,13 @@ impl IncomingCallNotification {
|
||||||
let join = active_call.update(cx, |active_call, cx| active_call.accept_incoming(cx));
|
let join = active_call.update(cx, |active_call, cx| active_call.accept_incoming(cx));
|
||||||
let caller_user_id = self.call.calling_user.id;
|
let caller_user_id = self.call.calling_user.id;
|
||||||
let initial_project_id = self.call.initial_project.as_ref().map(|project| project.id);
|
let initial_project_id = self.call.initial_project.as_ref().map(|project| project.id);
|
||||||
cx.spawn(|this, mut cx| async move {
|
let app_state = self.app_state.clone();
|
||||||
|
cx.app_context()
|
||||||
|
.spawn(|mut cx| async move {
|
||||||
join.await?;
|
join.await?;
|
||||||
if let Some(project_id) = initial_project_id {
|
if let Some(project_id) = initial_project_id {
|
||||||
this.update(&mut cx, |this, cx| {
|
cx.update(|cx| {
|
||||||
if let Some(app_state) = this.app_state.upgrade() {
|
if let Some(app_state) = app_state.upgrade() {
|
||||||
workspace::join_remote_project(
|
workspace::join_remote_project(
|
||||||
project_id,
|
project_id,
|
||||||
caller_user_id,
|
caller_user_id,
|
||||||
|
@ -91,7 +93,7 @@ impl IncomingCallNotification {
|
||||||
)
|
)
|
||||||
.detach_and_log_err(cx);
|
.detach_and_log_err(cx);
|
||||||
}
|
}
|
||||||
})?;
|
});
|
||||||
}
|
}
|
||||||
anyhow::Ok(())
|
anyhow::Ok(())
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue