Skip to content

Commit

Permalink
Don't prompt to leave a call you're not in
Browse files Browse the repository at this point in the history
  • Loading branch information
ConradIrwin committed Feb 12, 2024
1 parent 382304f commit 2029ede
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions crates/workspace/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,9 @@ impl Workspace {
if let Some(active_call) = active_call {
if !quitting
&& workspace_count == 1
&& active_call.read_with(&cx, |call, _| call.room().is_some())?
&& active_call.read_with(&cx, |call, cx| {
call.room().is_some_and(|room| room.read(cx).in_call())
})?
{
let answer = window.update(&mut cx, |_, cx| {
cx.prompt(
Expand All @@ -1230,12 +1232,11 @@ impl Workspace {

if answer.await.log_err() == Some(1) {
return anyhow::Ok(false);
} else {
active_call
.update(&mut cx, |call, cx| call.hang_up(cx))?
.await
.log_err();
}
active_call
.update(&mut cx, |call, cx| call.hang_up(cx))?
.await
.log_err();
}
}

Expand Down

0 comments on commit 2029ede

Please sign in to comment.