Skip to content

Commit 1919acd

Browse files
committed
Simplify latest state tasks stuff
The `latestStateTasks` field in the sent subscription data only ever contains 5 tasks, so we don't need to slice the array here. Also it the data ordered by most recently triggered, so don't re-sort this here.
1 parent 8f947c8 commit 1919acd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/components/cylc/TaskStateBadge.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
<template v-if="latestTasks.length">
3030
Latest:
3131
<span
32-
v-for="(task, index) in latestTasks.slice(0, maxLatestTasks)"
33-
:key="index"
32+
v-for="task in latestTasks"
33+
:key="task"
3434
class="text-grey-lighten-1"
3535
>
3636
<br/>{{ task }}

src/components/cylc/tree/GScanTreeItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function getStatesInfo (node, stateTotals = {}, latestTasks = {}) {
130130
latestTasks[state] = [
131131
...(latestTasks[state] ?? []),
132132
...nodeLatestTasks,
133-
].sort().reverse() // cycle point descending order
133+
]
134134
}
135135
}
136136
}

0 commit comments

Comments
 (0)