Fix conditional and custom panel updated > update (#5891)

This commit is contained in:
Bram Kragten 2020-05-15 14:54:23 +02:00 committed by GitHub
parent b61cf60faf
commit 67e17d4016
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -43,7 +43,8 @@ export class HaPanelCustom extends UpdatingElement {
this._cleanupPanel();
}
protected updated(changedProps: PropertyValues) {
protected update(changedProps: PropertyValues) {
super.update(changedProps);
if (changedProps.has("panel")) {
// Clean up old things if we had a panel
if (changedProps.get("panel")) {

View File

@ -1,4 +1,9 @@
import { customElement, property, UpdatingElement } from "lit-element";
import {
customElement,
property,
UpdatingElement,
PropertyValues,
} from "lit-element";
import { HomeAssistant } from "../../../types";
import { ConditionalCardConfig } from "../cards/types";
import {
@ -40,7 +45,8 @@ export class HuiConditionalBase extends UpdatingElement {
this._config = config;
}
protected update(): void {
protected update(changed: PropertyValues): void {
super.update(changed);
if (!this._element || !this.hass || !this._config) {
return;
}