diff --git a/crates/editor/src/git/project_diff.rs b/crates/editor/src/git/project_diff.rs index 2c60ae4204..e3d9f6abd6 100644 --- a/crates/editor/src/git/project_diff.rs +++ b/crates/editor/src/git/project_diff.rs @@ -62,13 +62,15 @@ struct Changes { } impl ProjectDiffEditor { - fn register(workspace: &mut Workspace, cx: &mut ViewContext) { - if cx.is_staff() { - workspace.register_action(Self::deploy); - } + fn register(workspace: &mut Workspace, _: &mut ViewContext) { + workspace.register_action(Self::deploy); } fn deploy(workspace: &mut Workspace, _: &Deploy, cx: &mut ViewContext) { + if !cx.is_staff() { + return; + } + if let Some(existing) = workspace.item_of_type::(cx) { workspace.activate_item(&existing, true, true, cx); } else {