Skip to content

Commit

Permalink
fix sorting #402
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Apr 17, 2021
1 parent 790bb08 commit da7eded
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@ export default function () {

if (state.clientTreeSort === "alphafail") {
// move failing clients to the top
const sortedByFailing = output.sort(a => a.color === "negative" ? -1 : 1);
const failing = output.filter(i => i.color === "negative" || i.color === "warning");
const ok = output.filter(i => i.color !== "negative" && i.color !== "warning");
const sortedByFailing = [...failing, ...ok];
commit("loadTree", sortedByFailing);
} else {
commit("loadTree", output);
Expand Down

0 comments on commit da7eded

Please sign in to comment.