Filter out empty projects in contacts panel

This commit is contained in:
Nathan Sobo 2022-05-09 20:57:41 -06:00
parent ef868ff023
commit 4e9924c717
2 changed files with 126 additions and 113 deletions

View file

@ -501,6 +501,12 @@ impl Contact {
}
Ok(Self { user, projects })
}
pub fn non_empty_projects(&self) -> impl Iterator<Item = &ProjectMetadata> {
self.projects
.iter()
.filter(|project| !project.worktree_root_names.is_empty())
}
}
async fn fetch_avatar(http: &dyn HttpClient, url: &str) -> Result<Arc<ImageData>> {