Fix dashboard crashed when deleting hidden area (#18832)

This commit is contained in:
Paul Bottein 2023-11-30 11:59:31 +01:00 committed by GitHub
parent 416a2a080d
commit 79f5ec0cd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -130,8 +130,8 @@ export const areaCompare =
const indexA = order ? order.indexOf(a) : -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;
const nameA = entries?.[a]?.name ?? a;
const nameB = entries?.[b]?.name ?? b;
return stringCompare(nameA, nameB);
}
if (indexA === -1) {

View File

@ -476,7 +476,7 @@ export const generateDefaultViewConfig = (
if (areasPrefs?.hidden) {
for (const area of areasPrefs.hidden) {
splittedByAreaDevice.areasWithEntities[area] = [];
delete splittedByAreaDevice.areasWithEntities[area];
}
}