Sort projects by name on the home screen

This commit is contained in:
Rūdolfs Ošiņš
2025-03-27 15:41:36 +01:00
parent 31e273395f
commit 5c5685d560
2 changed files with 11 additions and 1 deletions
+4
View File
@@ -94,6 +94,10 @@ impl ProjectPayload {
pub fn new(data: ProjectPayloadData, meta: ProjectPayloadMeta) -> Self {
Self { data, meta }
}
pub fn name(&self) -> &str {
&self.data.name
}
}
impl TryFrom<identity::doc::Payload> for ProjectPayloadData {
+7 -1
View File
@@ -57,7 +57,13 @@ pub trait Repo: Profile {
entries.push(repo_info)
}
entries.sort_by(|a, b| b.last_commit_timestamp.cmp(&a.last_commit_timestamp));
entries.sort_by_key(|repo_info| {
repo_info
.payloads
.project
.as_ref()
.map(|p| p.name().to_lowercase())
});
Ok::<_, Error>(entries)
}