Fix for empty card lists
This commit is contained in:
parent
03496c4ca0
commit
abbf4bbec6
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
|||||||
import { LitElement, html, css } from "card-tools/src/lit-element";
|
import { LitElement, html, css } from "card-tools/src/lit-element";
|
||||||
// import "card-tools/src/card-maker";
|
import "card-tools/src/card-maker";
|
||||||
import { hass } from "card-tools/src/hass";
|
import { hass } from "card-tools/src/hass";
|
||||||
|
|
||||||
import {buildLayout} from "./layout";
|
import {buildLayout} from "./layout";
|
||||||
@ -38,11 +38,13 @@ class LayoutCard extends LitElement {
|
|||||||
if(location.hash === "")
|
if(location.hash === "")
|
||||||
setTimeout(() => this.place_cards(), 100)
|
setTimeout(() => this.place_cards(), 100)
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async updated(changedproperties) {
|
async updated(changedproperties) {
|
||||||
if(!this.cards.length) {
|
if(!this.cards.length
|
||||||
|
&& ((this._config.entities && this._config.entities.length)
|
||||||
|
|| (this._config.cards && this._config.cards.length))
|
||||||
|
) {
|
||||||
// Build cards and layout
|
// Build cards and layout
|
||||||
this.cards = await this.build_cards();
|
this.cards = await this.build_cards();
|
||||||
this.place_cards();
|
this.place_cards();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user