mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Restore alphabetical sorting to Areas (#19897)
This commit is contained in:
parent
f4c932ef9c
commit
ccdd906e2f
@ -1,12 +1,17 @@
|
|||||||
import { Connection, createCollection } from "home-assistant-js-websocket";
|
import { Connection, createCollection } from "home-assistant-js-websocket";
|
||||||
import { Store } from "home-assistant-js-websocket/dist/store";
|
import { Store } from "home-assistant-js-websocket/dist/store";
|
||||||
|
import { stringCompare } from "../common/string/compare";
|
||||||
import { debounce } from "../common/util/debounce";
|
import { debounce } from "../common/util/debounce";
|
||||||
import { AreaRegistryEntry } from "./area_registry";
|
import { AreaRegistryEntry } from "./area_registry";
|
||||||
|
|
||||||
const fetchAreaRegistry = (conn: Connection) =>
|
const fetchAreaRegistry = (conn: Connection) =>
|
||||||
conn.sendMessagePromise<AreaRegistryEntry[]>({
|
conn
|
||||||
type: "config/area_registry/list",
|
.sendMessagePromise<AreaRegistryEntry[]>({
|
||||||
});
|
type: "config/area_registry/list",
|
||||||
|
})
|
||||||
|
.then((areas) =>
|
||||||
|
areas.sort((ent1, ent2) => stringCompare(ent1.name, ent2.name))
|
||||||
|
);
|
||||||
|
|
||||||
const subscribeAreaRegistryUpdates = (
|
const subscribeAreaRegistryUpdates = (
|
||||||
conn: Connection,
|
conn: Connection,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user