mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
Fix set theme on panel (#3749)
This commit is contained in:
parent
fca885a17a
commit
31ae115062
@ -28,18 +28,20 @@ export class HUIPanelView extends UpdatingElement {
|
|||||||
const hass = this.hass!;
|
const hass = this.hass!;
|
||||||
const hassChanged = changedProperties.has("hass");
|
const hassChanged = changedProperties.has("hass");
|
||||||
const oldHass = changedProperties.get("hass") as this["hass"] | undefined;
|
const oldHass = changedProperties.get("hass") as this["hass"] | undefined;
|
||||||
|
const configChanged = changedProperties.has("config");
|
||||||
|
|
||||||
if (changedProperties.has("config")) {
|
if (configChanged) {
|
||||||
this._createCard();
|
this._createCard();
|
||||||
} else if (hassChanged) {
|
} else if (hassChanged) {
|
||||||
(this.lastChild! as LovelaceCard).hass = this.hass;
|
(this.lastChild! as LovelaceCard).hass = this.hass;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
hassChanged &&
|
configChanged ||
|
||||||
oldHass &&
|
(hassChanged &&
|
||||||
(hass.themes !== oldHass.themes ||
|
oldHass &&
|
||||||
hass.selectedTheme !== oldHass.selectedTheme)
|
(hass.themes !== oldHass.themes ||
|
||||||
|
hass.selectedTheme !== oldHass.selectedTheme))
|
||||||
) {
|
) {
|
||||||
applyThemesOnElement(this, hass.themes, this.config!.theme);
|
applyThemesOnElement(this, hass.themes, this.config!.theme);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user