From ad556a43f9497a8d94edaed96637659df3954a3a Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Tue, 12 Dec 2023 05:25:12 -0800 Subject: [PATCH] Sort default dashboard area cards by alphabetical order if no order specified (#18989) --- src/data/area_registry.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/area_registry.ts b/src/data/area_registry.ts index 769c02c97e31..d51f7c528f77 100644 --- a/src/data/area_registry.ts +++ b/src/data/area_registry.ts @@ -128,7 +128,7 @@ export const areaCompare = (entries?: HomeAssistant["areas"], order?: string[]) => (a: string, b: string) => { const indexA = order ? order.indexOf(a) : -1; - const indexB = order ? order.indexOf(b) : 1; + const indexB = order ? order.indexOf(b) : -1; if (indexA === -1 && indexB === -1) { const nameA = entries?.[a]?.name ?? a; const nameB = entries?.[b]?.name ?? b;