mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Fix dashboard crashed when deleting hidden area (#18832)
This commit is contained in:
parent
416a2a080d
commit
79f5ec0cd5
@ -130,8 +130,8 @@ export const areaCompare =
|
|||||||
const indexA = order ? order.indexOf(a) : -1;
|
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) {
|
if (indexA === -1 && indexB === -1) {
|
||||||
const nameA = entries?.[a].name ?? a;
|
const nameA = entries?.[a]?.name ?? a;
|
||||||
const nameB = entries?.[b].name ?? b;
|
const nameB = entries?.[b]?.name ?? b;
|
||||||
return stringCompare(nameA, nameB);
|
return stringCompare(nameA, nameB);
|
||||||
}
|
}
|
||||||
if (indexA === -1) {
|
if (indexA === -1) {
|
||||||
|
@ -476,7 +476,7 @@ export const generateDefaultViewConfig = (
|
|||||||
|
|
||||||
if (areasPrefs?.hidden) {
|
if (areasPrefs?.hidden) {
|
||||||
for (const area of areasPrefs.hidden) {
|
for (const area of areasPrefs.hidden) {
|
||||||
splittedByAreaDevice.areasWithEntities[area] = [];
|
delete splittedByAreaDevice.areasWithEntities[area];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user