Fix prompting the user to hang up when opening a workspace (#7408)
Before this change if you had joined a call with an empty workspace, then we'd prompt you to hang up when you tried to open a recent project. Release Notes: - Fixed an erroneous prompt to "hang up" when opening a new project from an empty workspace.
This commit is contained in:
parent
1a40c9f0f2
commit
d04a286634
1 changed files with 2 additions and 10 deletions
|
@ -1345,22 +1345,14 @@ impl Workspace {
|
||||||
let is_remote = self.project.read(cx).is_remote();
|
let is_remote = self.project.read(cx).is_remote();
|
||||||
let has_worktree = self.project.read(cx).worktrees().next().is_some();
|
let has_worktree = self.project.read(cx).worktrees().next().is_some();
|
||||||
let has_dirty_items = self.items(cx).any(|item| item.is_dirty(cx));
|
let has_dirty_items = self.items(cx).any(|item| item.is_dirty(cx));
|
||||||
let close_task = if is_remote || has_worktree || has_dirty_items {
|
let window_to_replace = if is_remote || has_worktree || has_dirty_items {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
Some(self.prepare_to_close(false, cx))
|
window
|
||||||
};
|
};
|
||||||
let app_state = self.app_state.clone();
|
let app_state = self.app_state.clone();
|
||||||
|
|
||||||
cx.spawn(|_, mut cx| async move {
|
cx.spawn(|_, mut cx| async move {
|
||||||
let window_to_replace = if let Some(close_task) = close_task {
|
|
||||||
if !close_task.await? {
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
window
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
};
|
|
||||||
cx.update(|cx| open_paths(&paths, &app_state, window_to_replace, cx))?
|
cx.update(|cx| open_paths(&paths, &app_state, window_to_replace, cx))?
|
||||||
.await?;
|
.await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue