mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 16:56:35 +00:00
Fix picture header footer upgrade (#5945)
This commit is contained in:
parent
28d26065e4
commit
dcd6c6f06f
@ -6,6 +6,7 @@ import {
|
|||||||
LitElement,
|
LitElement,
|
||||||
property,
|
property,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
|
PropertyValues,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import { classMap } from "lit-html/directives/class-map";
|
import { classMap } from "lit-html/directives/class-map";
|
||||||
import { ifDefined } from "lit-html/directives/if-defined";
|
import { ifDefined } from "lit-html/directives/if-defined";
|
||||||
@ -30,7 +31,7 @@ export class HuiPictureHeaderFooter extends LitElement
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public hass?: HomeAssistant;
|
@property() public hass?: HomeAssistant;
|
||||||
|
|
||||||
@property() protected _config?: PictureHeaderFooterConfig;
|
@property() protected _config?: PictureHeaderFooterConfig;
|
||||||
|
|
||||||
@ -42,6 +43,13 @@ export class HuiPictureHeaderFooter extends LitElement
|
|||||||
this._config = config;
|
this._config = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected shouldUpdate(changedProps: PropertyValues): boolean {
|
||||||
|
if (changedProps.size === 1 && changedProps.has("hass")) {
|
||||||
|
return !changedProps.get("hass");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (!this._config || !this.hass) {
|
if (!this._config || !this.hass) {
|
||||||
return html``;
|
return html``;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user