Fix create backup checkbox (#10756)

This commit is contained in:
Joakim Sørensen 2021-12-02 11:54:05 +01:00 committed by GitHub
parent 2fe8f5ff27
commit 2a5fc5181e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -194,7 +194,7 @@ class UpdateAvailableCard extends LitElement {
<ha-progress-button
.disabled=${!this._version ||
(this._shouldCreateBackup &&
this.supervisor.info.state !== "running")}
this.supervisor.info?.state !== "running")}
@click=${this._update}
raised
>
@ -224,7 +224,11 @@ class UpdateAvailableCard extends LitElement {
}
get _shouldCreateBackup(): boolean {
return this.shadowRoot?.querySelector("ha-checkbox")?.checked || true;
const checkbox = this.shadowRoot?.querySelector("ha-checkbox");
if (checkbox) {
return checkbox.checked;
}
return true;
}
get _version(): string {