collab tweaks (#7706)

- Don't leave call when clicking on channel
- Don't prompt to leave a call you're not in

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2024-02-12 16:08:35 -07:00 committed by GitHub
parent d13a731cd6
commit 21d2b5fe50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 33 deletions

View file

@ -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(
@ -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();
}
}