Skip to content

Commit

Permalink
Fix media control card background image
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten committed Dec 4, 2023
1 parent 14a49d6 commit d2624b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/panels/lovelace/cards/hui-media-control-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ export class HuiMediaControlCard extends LitElement implements LovelaceCard {
}

this._config = config;

this.updateComplete.then(() => this._measureCard());
}

public connectedCallback(): void {
Expand Down Expand Up @@ -339,15 +341,12 @@ export class HuiMediaControlCard extends LitElement implements LovelaceCard {

protected firstUpdated(): void {
this._attachObserver();
this._measureCard();
}

public willUpdate(changedProps: PropertyValues): void {
super.willUpdate(changedProps);

if (!this.hasUpdated) {
this._measureCard();
}

if (
!this._config ||
!this.hass ||
Expand Down Expand Up @@ -468,6 +467,7 @@ export class HuiMediaControlCard extends LitElement implements LovelaceCard {

private _measureCard() {
const card = this.shadowRoot!.querySelector("ha-card");

if (!card) {
return;
}
Expand Down

0 comments on commit d2624b2

Please sign in to comment.