From b776fe0e80203f7a602bd177bc932e104da1914e Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 22 Apr 2022 22:48:54 +0000 Subject: [PATCH] fix sorting of clients tree --- src/store/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index cc7cdb9..c12d32f 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -253,14 +253,15 @@ export default function () { } + const sorted = output.sort((a, b) => a.label.localeCompare(b.label)); if (state.clientTreeSort === "alphafail") { // move failing clients to the top - const failing = output.filter(i => i.color === "negative" || i.color === "warning"); - const ok = output.filter(i => i.color !== "negative" && i.color !== "warning"); + const failing = sorted.filter(i => i.color === "negative" || i.color === "warning"); + const ok = sorted.filter(i => i.color !== "negative" && i.color !== "warning"); const sortedByFailing = [...failing, ...ok]; commit("loadTree", sortedByFailing); } else { - commit("loadTree", output); + commit("loadTree", sorted); } })