mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 16:26:43 +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() {
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user