mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 08:46:35 +00:00
Track when cards get defined (#1310)
This commit is contained in:
parent
691b80c08a
commit
b6ee5442f0
@ -110,6 +110,7 @@ class HUIView extends PolymerElement {
|
|||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this._elements = [];
|
this._elements = [];
|
||||||
|
this._whenDefined = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
_getElements(cards) {
|
_getElements(cards) {
|
||||||
@ -127,6 +128,10 @@ class HUIView extends PolymerElement {
|
|||||||
error = `Unknown card type encountered: "${cardConfig.type}".`;
|
error = `Unknown card type encountered: "${cardConfig.type}".`;
|
||||||
} else if (!customElements.get(tag)) {
|
} else if (!customElements.get(tag)) {
|
||||||
error = `Custom element doesn't exist: "${tag}".`;
|
error = `Custom element doesn't exist: "${tag}".`;
|
||||||
|
if (!(tag in this._whenDefined)) {
|
||||||
|
this._whenDefined[tag] = customElements.whenDefined(tag)
|
||||||
|
.then(() => this._configChanged());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (error) {
|
if (error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user