workspace: Do not prompt for hanging up current call when replacing last visible project (#36697)
This fixes a bug where in order to open a new project in a call (even if it's not shared), you need to hang up. Release Notes: - N/A
This commit is contained in:
parent
54df43e06f
commit
92bbcdeb7d
1 changed files with 33 additions and 17 deletions
|
@ -2249,10 +2249,10 @@ impl Workspace {
|
|||
})?;
|
||||
|
||||
if let Some(active_call) = active_call
|
||||
&& close_intent != CloseIntent::Quit
|
||||
&& workspace_count == 1
|
||||
&& active_call.read_with(cx, |call, _| call.room().is_some())?
|
||||
{
|
||||
if close_intent == CloseIntent::CloseWindow {
|
||||
let answer = cx.update(|window, cx| {
|
||||
window.prompt(
|
||||
PromptLevel::Warning,
|
||||
|
@ -2272,6 +2272,22 @@ impl Workspace {
|
|||
.log_err();
|
||||
}
|
||||
}
|
||||
if close_intent == CloseIntent::ReplaceWindow {
|
||||
_ = active_call.update(cx, |this, cx| {
|
||||
let workspace = cx
|
||||
.windows()
|
||||
.iter()
|
||||
.filter_map(|window| window.downcast::<Workspace>())
|
||||
.next()
|
||||
.unwrap();
|
||||
let project = workspace.read(cx)?.project.clone();
|
||||
if project.read(cx).is_shared() {
|
||||
this.unshare_project(project, cx)?;
|
||||
}
|
||||
Ok::<_, anyhow::Error>(())
|
||||
})?;
|
||||
}
|
||||
}
|
||||
|
||||
let save_result = this
|
||||
.update_in(cx, |this, window, cx| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue