fix sorting #402

This commit is contained in:
wh1te909 2021-04-17 20:06:07 +00:00
parent 790bb08718
commit da7ededfb1
1 changed files with 3 additions and 1 deletions

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