Merge pull request #2273 from zed-industries/fix-dock-opening-in-collaboration

Fix dock opening on collaboration
This commit is contained in:
Max Brunsfeld 2023-03-13 10:04:43 -07:00
parent 54b30f0fb7
commit 5ec3b7b137
2 changed files with 8 additions and 7 deletions

View file

@ -165,12 +165,13 @@ impl PickerDelegate for RecentProjectsView {
} }
fn confirm(&mut self, cx: &mut ViewContext<Self>) { fn confirm(&mut self, cx: &mut ViewContext<Self>) {
let selected_match = &self.matches[self.selected_index()]; if let Some(selected_match) = &self.matches.get(self.selected_index()) {
let workspace_location = &self.workspace_locations[selected_match.candidate_id]; let workspace_location = &self.workspace_locations[selected_match.candidate_id];
cx.dispatch_global_action(OpenPaths { cx.dispatch_global_action(OpenPaths {
paths: workspace_location.paths().as_ref().clone(), paths: workspace_location.paths().as_ref().clone(),
}); });
cx.emit(Event::Dismissed); cx.emit(Event::Dismissed);
}
} }
fn dismiss(&mut self, cx: &mut ViewContext<Self>) { fn dismiss(&mut self, cx: &mut ViewContext<Self>) {

View file

@ -754,7 +754,7 @@ impl Workspace {
cx.defer(move |_, cx| { cx.defer(move |_, cx| {
Self::load_from_serialized_workspace(weak_handle, serialized_workspace, cx) Self::load_from_serialized_workspace(weak_handle, serialized_workspace, cx)
}); });
} else { } else if project.read(cx).is_local() {
if cx.global::<Settings>().default_dock_anchor != DockAnchor::Expanded { if cx.global::<Settings>().default_dock_anchor != DockAnchor::Expanded {
Dock::show(&mut this, false, cx); Dock::show(&mut this, false, cx);
} }