Set current location after calling another user
This commit is contained in:
parent
59aaf4ce1b
commit
34cb742db1
1 changed files with 21 additions and 5 deletions
|
@ -825,9 +825,25 @@ impl ContactsPopover {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn call(&mut self, action: &Call, cx: &mut ViewContext<Self>) {
|
fn call(&mut self, action: &Call, cx: &mut ViewContext<Self>) {
|
||||||
ActiveCall::global(cx)
|
let recipient_user_id = action.recipient_user_id;
|
||||||
.update(cx, |active_call, cx| {
|
let initial_project = action.initial_project.clone();
|
||||||
active_call.invite(action.recipient_user_id, action.initial_project.clone(), cx)
|
let window_id = cx.window_id();
|
||||||
|
|
||||||
|
let active_call = ActiveCall::global(cx);
|
||||||
|
cx.spawn_weak(|_, mut cx| async move {
|
||||||
|
active_call
|
||||||
|
.update(&mut cx, |active_call, cx| {
|
||||||
|
active_call.invite(recipient_user_id, initial_project.clone(), cx)
|
||||||
|
})
|
||||||
|
.await?;
|
||||||
|
if cx.update(|cx| cx.window_is_active(window_id)) {
|
||||||
|
active_call
|
||||||
|
.update(&mut cx, |call, cx| {
|
||||||
|
call.set_location(initial_project.as_ref(), cx)
|
||||||
|
})
|
||||||
|
.await?;
|
||||||
|
}
|
||||||
|
anyhow::Ok(())
|
||||||
})
|
})
|
||||||
.detach_and_log_err(cx);
|
.detach_and_log_err(cx);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue