Skip to content

Commit

Permalink
Hide "Browse Media" button for unavailable media players (#20629)
Browse files Browse the repository at this point in the history
* Hide "Browse Media" button for unavailable media players
  • Loading branch information
spacegaier authored Apr 27, 2024
1 parent cefe612 commit b54cfeb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dialogs/more-info/controls/more-info-media_player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import "../../../components/ha-select";
import "../../../components/ha-slider";
import "../../../components/ha-svg-icon";
import { showMediaBrowserDialog } from "../../../components/media-player/show-media-browser-dialog";
import { isUnavailableState } from "../../../data/entity";
import {
MediaPickedEvent,
MediaPlayerEntity,
Expand Down Expand Up @@ -62,7 +63,8 @@ class MoreInfoMediaPlayer extends LitElement {
`
)}
</div>
${supportsFeature(stateObj, MediaPlayerEntityFeature.BROWSE_MEDIA)
${!isUnavailableState(stateObj.state) &&
supportsFeature(stateObj, MediaPlayerEntityFeature.BROWSE_MEDIA)
? html`
<mwc-button
.label=${this.hass.localize(
Expand Down

0 comments on commit b54cfeb

Please sign in to comment.