diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index a065ad4b80667f2d13264c53d8c4d45d53cf3b83..481086a8bb631e5876b5253bc6c2524a963353f2 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -166,13 +166,7 @@ impl ProjectPanel { fn new(workspace: &mut Workspace, cx: &mut ViewContext) -> View { let project = workspace.project().clone(); let project_panel = cx.new_view(|cx: &mut ViewContext| { - cx.observe(&project, |this, _, cx| { - this.update_visible_entries(None, cx); - cx.notify(); - }) - .detach(); let focus_handle = cx.focus_handle(); - cx.on_focus(&focus_handle, Self::focus_in).detach(); cx.subscribe(&project, |this, project, event, cx| match event { @@ -193,6 +187,10 @@ impl ProjectPanel { this.update_visible_entries(None, cx); cx.notify(); } + project::Event::WorktreeUpdatedEntries(_, _) | project::Event::WorktreeAdded => { + this.update_visible_entries(None, cx); + cx.notify(); + } _ => {} }) .detach();