forked from DigiLive/mushroom-strategy
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:
2
dist/mushroom-strategy.js
vendored
2
dist/mushroom-strategy.js
vendored
File diff suppressed because one or more lines are too long
@@ -86,10 +86,12 @@ class MushroomStrategy {
|
|||||||
const exposedDomainIds = Helper.getExposedDomainIds();
|
const exposedDomainIds = Helper.getExposedDomainIds();
|
||||||
const area = info.view.strategy.options.area;
|
const area = info.view.strategy.options.area;
|
||||||
const viewCards = [...(area.extra_cards ?? [])];
|
const viewCards = [...(area.extra_cards ?? [])];
|
||||||
|
let defaultExists = false;
|
||||||
|
|
||||||
// Create cards for each domain.
|
// Create cards for each domain.
|
||||||
for (const domain of exposedDomainIds) {
|
for (const domain of exposedDomainIds) {
|
||||||
if (domain === "default") {
|
if (domain === "default") {
|
||||||
|
defaultExists = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,6 +190,7 @@ class MushroomStrategy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (defaultExists) {
|
||||||
// TODO: Check if default is hidden
|
// TODO: Check if default is hidden
|
||||||
// Create cards for any other domain.
|
// Create cards for any other domain.
|
||||||
// Collect device entities of the current area.
|
// Collect device entities of the current area.
|
||||||
@@ -235,6 +238,7 @@ class MushroomStrategy {
|
|||||||
cards: miscellaneousCards,
|
cards: miscellaneousCards,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Return cards.
|
// Return cards.
|
||||||
return {
|
return {
|
||||||
|
Reference in New Issue
Block a user