fix sorting #402

This commit is contained in:
wh1te909
2021-04-17 20:06:07 +00:00
parent 2afe25b2dd
commit fed79ea517

View File

@@ -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);