From fed79ea517db3ea35d8acc8346499cd8c55db941 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 17 Apr 2021 20:06:07 +0000 Subject: [PATCH] fix sorting #402 --- src/store/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index 21c10a2..f801a3f 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -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);