mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 10:10:30 +08:00
Sort projects in seed view by most recent activity
Uses the projects activity, fetched from `/projects/${id}/activity`
which is an array of commit timestamps.
So could suffer from some errors if commits with non current timestamps
are being used.
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
@@ -58,10 +58,14 @@ export async function loadProjects(
|
||||
};
|
||||
}),
|
||||
);
|
||||
// Sorts projects by most recent commit descending.
|
||||
const sortedProjects = results.sort(
|
||||
(a, b) => b.activity[0].time - a.activity[0].time,
|
||||
);
|
||||
|
||||
return {
|
||||
total: nodeStats.projects.count,
|
||||
projects: results,
|
||||
projects: sortedProjects,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user