mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +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 hassChanged = changedProperties.has("hass");
|
||||
const oldHass = changedProperties.get("hass") as this["hass"] | undefined;
|
||||
const configChanged = changedProperties.has("config");
|
||||
|
||||
if (changedProperties.has("config")) {
|
||||
if (configChanged) {
|
||||
this._createCard();
|
||||
} else if (hassChanged) {
|
||||
(this.lastChild! as LovelaceCard).hass = this.hass;
|
||||
}
|
||||
|
||||
if (
|
||||
hassChanged &&
|
||||
oldHass &&
|
||||
(hass.themes !== oldHass.themes ||
|
||||
hass.selectedTheme !== oldHass.selectedTheme)
|
||||
configChanged ||
|
||||
(hassChanged &&
|
||||
oldHass &&
|
||||
(hass.themes !== oldHass.themes ||
|
||||
hass.selectedTheme !== oldHass.selectedTheme))
|
||||
) {
|
||||
applyThemesOnElement(this, hass.themes, this.config!.theme);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user