Skip to content

Commit

Permalink
Fix for empty card lists
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Nov 13, 2019
1 parent 03496c4 commit abbf4bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion layout-card.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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 {buildLayout} from "./layout";
Expand Down Expand Up @@ -38,11 +38,13 @@ class LayoutCard extends LitElement {
if(location.hash === "")
setTimeout(() => this.place_cards(), 100)
});

}

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
this.cards = await this.build_cards();
this.place_cards();
Expand Down

0 comments on commit abbf4bb

Please sign in to comment.