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` return html`
<div class="content"> <div class="content">
${hasOptions || hasSchema || this.addon.network || this.addon.audio ${(hasOptions && hasSchema) || this.addon.network || this.addon.audio
? html` ? html`
${hasOptions || hasSchema ${hasOptions && hasSchema
? html` ? html`
<hassio-addon-config <hassio-addon-config
.hass=${this.hass} .hass=${this.hass}

View File

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