Guard controls in more info media player (#11851)

This commit is contained in:
Paulus Schoutsen 2022-02-24 23:31:59 -08:00 committed by GitHub
parent f0c4b92dbb
commit 91e4557625
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,19 +52,21 @@ class MoreInfoMediaPlayer extends LitElement {
return html` return html`
<div class="controls"> <div class="controls">
<div class="basic-controls"> <div class="basic-controls">
${controls!.map( ${!controls
(control) => html` ? ""
<ha-icon-button : controls.map(
action=${control.action} (control) => html`
@click=${this._handleClick} <ha-icon-button
.path=${control.icon} action=${control.action}
.label=${this.hass.localize( @click=${this._handleClick}
`ui.card.media_player.${control.action}` .path=${control.icon}
)} .label=${this.hass.localize(
> `ui.card.media_player.${control.action}`
</ha-icon-button> )}
` >
)} </ha-icon-button>
`
)}
</div> </div>
${supportsFeature(stateObj, SUPPORT_BROWSE_MEDIA) ${supportsFeature(stateObj, SUPPORT_BROWSE_MEDIA)
? html` ? html`