Don't show add-on config if no schema (#8361)

This commit is contained in:
Joakim Sørensen 2021-02-09 11:51:46 +01:00 committed by GitHub
parent a1d66aef0c
commit c7821b9cee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 8 deletions

View File

@ -33,9 +33,9 @@ class HassioAddonConfigDashboard extends LitElement {
return html`
<div class="content">
${hasOptions || hasSchema || this.addon.network || this.addon.audio
${(hasOptions && hasSchema) || this.addon.network || this.addon.audio
? html`
${hasOptions || hasSchema
${hasOptions && hasSchema
? html`
<hassio-addon-config
.hass=${this.hass}

View File

@ -108,12 +108,10 @@ class HassioAddonConfig extends LitElement {
protected firstUpdated(changedProps) {
super.firstUpdated(changedProps);
this._canShowSchema =
this.addon.schema !== null &&
!this.addon.schema.find(
// @ts-ignore
(entry) => !SUPPORTED_UI_TYPES.includes(entry.type) || entry.multiple
);
this._canShowSchema = !this.addon.schema!.find(
// @ts-ignore
(entry) => !SUPPORTED_UI_TYPES.includes(entry.type) || entry.multiple
);
this._yamlMode = !this._canShowSchema;
}