From 404dd43c3079044057c3e86ab1d4ee4bdbf7d1bd Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Mon, 13 Mar 2023 09:36:45 -0700 Subject: [PATCH 1/2] Fix dock opening on collaboration --- crates/workspace/src/workspace.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 43ae12b732938e0c02fb055a82632bfa7b163a5a..d5550f49637470b07eb193144fa843c865358882 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -750,7 +750,7 @@ impl Workspace { cx.defer(move |_, cx| { Self::load_from_serialized_workspace(weak_handle, serialized_workspace, cx) }); - } else { + } else if project.read(cx).is_local() { if cx.global::().default_dock_anchor != DockAnchor::Expanded { Dock::show(&mut this, false, cx); } From 097a768725ab2c327873d43008497256bfc23de4 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Mon, 13 Mar 2023 09:44:42 -0700 Subject: [PATCH 2/2] Remove panic in recent projects picker --- crates/recent_projects/src/recent_projects.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/crates/recent_projects/src/recent_projects.rs b/crates/recent_projects/src/recent_projects.rs index f613ba4df2132fe8114f12045d03ccb9ef81cb72..e73d0b4fb51a5d4f94391fc15ed4f4ed23699ca7 100644 --- a/crates/recent_projects/src/recent_projects.rs +++ b/crates/recent_projects/src/recent_projects.rs @@ -165,12 +165,13 @@ impl PickerDelegate for RecentProjectsView { } fn confirm(&mut self, cx: &mut ViewContext) { - let selected_match = &self.matches[self.selected_index()]; - let workspace_location = &self.workspace_locations[selected_match.candidate_id]; - cx.dispatch_global_action(OpenPaths { - paths: workspace_location.paths().as_ref().clone(), - }); - cx.emit(Event::Dismissed); + if let Some(selected_match) = &self.matches.get(self.selected_index()) { + let workspace_location = &self.workspace_locations[selected_match.candidate_id]; + cx.dispatch_global_action(OpenPaths { + paths: workspace_location.paths().as_ref().clone(), + }); + cx.emit(Event::Dismissed); + } } fn dismiss(&mut self, cx: &mut ViewContext) {