Skip to content

Commit 5cb02a6

Browse files
authored
refactor(site): remove redundant client-side sorting of app statuses (#21102)
Depends on #21099
1 parent cfdd4a9 commit 5cb02a6

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

site/src/pages/WorkspacePage/AppStatuses.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,12 @@ export const AppStatuses: FC<AppStatusesProps> = ({
4747
referenceDate,
4848
}) => {
4949
const [displayStatuses, setDisplayStatuses] = useState(false);
50+
// Statuses are returned from the API sorted by created_at DESC, id DESC.
5051
const allStatuses: StatusWithAppInfo[] = agent.apps.flatMap((app) =>
51-
app.statuses
52-
.map((status) => ({
53-
...status,
54-
app,
55-
}))
56-
.sort(
57-
(a, b) =>
58-
new Date(b.created_at).getTime() - new Date(a.created_at).getTime(),
59-
),
52+
app.statuses.map((status) => ({
53+
...status,
54+
app,
55+
})),
6056
);
6157

6258
if (allStatuses.length === 0) {

0 commit comments

Comments
 (0)