refactor(site): remove redundant client-side sorting of app statuses (#21102)

Depends on #21099
This commit is contained in:
Mathias Fredriksson
2025-12-04 18:55:45 +02:00
committed by GitHub
parent cfdd4a9b88
commit 5cb02a6cc0
+5 -9
View File
@@ -47,16 +47,12 @@ export const AppStatuses: FC<AppStatusesProps> = ({
referenceDate,
}) => {
const [displayStatuses, setDisplayStatuses] = useState(false);
// Statuses are returned from the API sorted by created_at DESC, id DESC.
const allStatuses: StatusWithAppInfo[] = agent.apps.flatMap((app) =>
app.statuses
.map((status) => ({
...status,
app,
}))
.sort(
(a, b) =>
new Date(b.created_at).getTime() - new Date(a.created_at).getTime(),
),
app.statuses.map((status) => ({
...status,
app,
})),
);
if (allStatuses.length === 0) {