Fix picture glance editor + small opti in hui image (#8692)

This commit is contained in:
Bram Kragten 2021-03-25 14:17:32 +01:00 committed by GitHub
parent 77972c961b
commit af5b22a265
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 10 deletions

View File

@ -159,13 +159,14 @@ export class HuiImage extends LitElement {
})}
/>
`}
<div
id="brokenImage"
style=${styleMap({
height: `${this._lastImageHeight || "100"}px`,
display: this._loadError ? "block" : "none",
})}
></div>
${this._loadError
? html`<div
id="brokenImage"
style=${styleMap({
height: `${this._lastImageHeight || "100"}px`,
})}
></div>`
: ""}
</div>
`;
}

View File

@ -70,9 +70,12 @@ export class HuiPictureGlanceCardEditor extends LitElement
}
get _image(): string {
return this._config!.image || this._camera_image
? ""
: "https://www.home-assistant.io/images/merchandise/shirt-frontpage.png";
return (
this._config!.image ||
(this._camera_image
? ""
: "https://www.home-assistant.io/images/merchandise/shirt-frontpage.png")
);
}
get _camera_image(): string {