From d04a2866342565583d38f54929200c4bcbb6d4c9 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Mon, 5 Feb 2024 15:21:18 -0700 Subject: [PATCH] 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. --- crates/workspace/src/workspace.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 6ca74875b7..181f14386d 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -1345,22 +1345,14 @@ impl Workspace { let is_remote = self.project.read(cx).is_remote(); 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 close_task = if is_remote || has_worktree || has_dirty_items { + let window_to_replace = if is_remote || has_worktree || has_dirty_items { None } else { - Some(self.prepare_to_close(false, cx)) + window }; let app_state = self.app_state.clone(); 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))? .await?; Ok(())