1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-25 05:06:18 +00:00

Track when cards get defined (#1310)

This commit is contained in:
Paulus Schoutsen
2018-06-21 10:42:52 -04:00
committed by GitHub
parent 691b80c08a
commit b6ee5442f0

View File

@@ -110,6 +110,7 @@ class HUIView extends PolymerElement {
constructor() {
super();
this._elements = [];
this._whenDefined = {};
}
_getElements(cards) {
@@ -127,6 +128,10 @@ class HUIView extends PolymerElement {
error = `Unknown card type encountered: "${cardConfig.type}".`;
} else if (!customElements.get(tag)) {
error = `Custom element doesn't exist: "${tag}".`;
if (!(tag in this._whenDefined)) {
this._whenDefined[tag] = customElements.whenDefined(tag)
.then(() => this._configChanged());
}
}
}
if (error) {