mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Fix miniy fail (#1674)
This commit is contained in:
parent
7e0ff14f28
commit
15d21cc673
@ -7,9 +7,10 @@ class HuiErrorCard extends PolymerElement {
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
background-color: red;
|
||||
background-color: #ef5350;
|
||||
color: white;
|
||||
padding: 8px;
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
[[_config.error]]
|
||||
|
@ -61,11 +61,6 @@ function _createErrorElement(error, config) {
|
||||
return _createElement('hui-error-card', createErrorCardConfig(error, config));
|
||||
}
|
||||
|
||||
function _hideErrorElement(element) {
|
||||
element.style.display = 'None';
|
||||
return window.setTimeout(() => { element.style.display = ''; }, TIMEOUT);
|
||||
}
|
||||
|
||||
export default function createCardElement(config) {
|
||||
if (!config || typeof config !== 'object' || !config.type) {
|
||||
return _createErrorElement('No card type configured.', config);
|
||||
@ -78,7 +73,8 @@ export default function createCardElement(config) {
|
||||
return _createElement(tag, config);
|
||||
}
|
||||
const element = _createErrorElement(`Custom element doesn't exist: ${tag}.`, config);
|
||||
const timer = _hideErrorElement(element);
|
||||
element.style.display = 'None';
|
||||
const timer = window.setTimeout(() => { element.style.display = ''; }, TIMEOUT);
|
||||
|
||||
customElements.whenDefined(tag).then(() => {
|
||||
clearTimeout(timer);
|
||||
|
Loading…
x
Reference in New Issue
Block a user