mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-18 14:31:30 +03:00
Merge pull request #3699 from gitbutlerapp/sort-alphabetically
sort project list alphabetically
This commit is contained in:
commit
bb9fb079c4
@ -51,7 +51,7 @@ impl Storage {
|
|||||||
match self.inner.read(PROJECTS_FILE)? {
|
match self.inner.read(PROJECTS_FILE)? {
|
||||||
Some(projects) => {
|
Some(projects) => {
|
||||||
let all_projects: Vec<project::Project> = serde_json::from_str(&projects)?;
|
let all_projects: Vec<project::Project> = serde_json::from_str(&projects)?;
|
||||||
let all_projects: Vec<project::Project> = all_projects
|
let mut all_projects: Vec<project::Project> = all_projects
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|mut p| {
|
.map(|mut p| {
|
||||||
// backwards compatibility for description field
|
// backwards compatibility for description field
|
||||||
@ -63,6 +63,9 @@ impl Storage {
|
|||||||
p
|
p
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
all_projects.sort_by(|a, b| a.title.cmp(&b.title));
|
||||||
|
|
||||||
Ok(all_projects)
|
Ok(all_projects)
|
||||||
}
|
}
|
||||||
None => Ok(vec![]),
|
None => Ok(vec![]),
|
||||||
|
Loading…
Reference in New Issue
Block a user