Fix hiding default domain

this solution works, but it uses another variable. If you have a better idea, please feel free to share
This commit is contained in:
Aalian Khan
2023-09-09 19:05:59 -04:00
parent d2a582744c
commit 178a2fe003
2 changed files with 50 additions and 46 deletions

File diff suppressed because one or more lines are too long

View File

@@ -86,10 +86,12 @@ class MushroomStrategy {
const exposedDomainIds = Helper.getExposedDomainIds();
const area = info.view.strategy.options.area;
const viewCards = [...(area.extra_cards ?? [])];
let defaultExists = false;
// Create cards for each domain.
for (const domain of exposedDomainIds) {
if (domain === "default") {
defaultExists = true;
continue;
}
@@ -188,6 +190,7 @@ class MushroomStrategy {
}
}
if (defaultExists) {
// TODO: Check if default is hidden
// Create cards for any other domain.
// Collect device entities of the current area.
@@ -235,6 +238,7 @@ class MushroomStrategy {
cards: miscellaneousCards,
});
}
}
// Return cards.
return {