Lower frequency of popup warning when leaving a call
co-authored-by: conrad <conrad.irwin@gmail.com>
This commit is contained in:
parent
95342c8c33
commit
23ee8211c7
2 changed files with 13 additions and 2 deletions
|
@ -104,6 +104,10 @@ impl Room {
|
||||||
self.channel_id
|
self.channel_id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn is_sharing_project(&self) -> bool {
|
||||||
|
!self.shared_projects.is_empty()
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(any(test, feature = "test-support"))]
|
#[cfg(any(test, feature = "test-support"))]
|
||||||
pub fn is_connected(&self) -> bool {
|
pub fn is_connected(&self) -> bool {
|
||||||
if let Some(live_kit) = self.live_kit.as_ref() {
|
if let Some(live_kit) = self.live_kit.as_ref() {
|
||||||
|
|
|
@ -3165,10 +3165,17 @@ impl CollabPanel {
|
||||||
let window = cx.window();
|
let window = cx.window();
|
||||||
let active_call = ActiveCall::global(cx);
|
let active_call = ActiveCall::global(cx);
|
||||||
cx.spawn(|_, mut cx| async move {
|
cx.spawn(|_, mut cx| async move {
|
||||||
if active_call.read_with(&mut cx, |active_call, _| active_call.room().is_some()) {
|
if active_call.read_with(&mut cx, |active_call, cx| {
|
||||||
|
if let Some(room) = active_call.room() {
|
||||||
|
let room = room.read(cx);
|
||||||
|
room.is_sharing_project() && room.remote_participants().len() > 0
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}) {
|
||||||
let answer = window.prompt(
|
let answer = window.prompt(
|
||||||
PromptLevel::Warning,
|
PromptLevel::Warning,
|
||||||
"Do you want to leave the current call?",
|
"Leaving this call will unshare your current project.\nDo you want to switch channels?",
|
||||||
&["Yes, Join Channel", "Cancel"],
|
&["Yes, Join Channel", "Cancel"],
|
||||||
&mut cx,
|
&mut cx,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue