From 10af7be278af201e47f16af5f0e4456dfa6ff215 Mon Sep 17 00:00:00 2001 From: Jake Fulmine Date: Sat, 21 Jan 2023 21:07:55 +0100 Subject: [PATCH] fix(dashboard): sort by name alphabetically if no theres color --- dashboard/src/components/list/functions.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dashboard/src/components/list/functions.ts b/dashboard/src/components/list/functions.ts index 8753d945..7786feb9 100644 --- a/dashboard/src/components/list/functions.ts +++ b/dashboard/src/components/list/functions.ts @@ -126,6 +126,8 @@ function sort(list: T[], options: ListOptions): T[] { let aa = Number("0x" + a.color); let bb = Number("0x" + b.color); + if (a.color === b.color) return a.name.localeCompare(b.name); + if (a.color === null) return 1; if (b.color === null) return -1;