mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Update to actually set loading
This commit is contained in:
parent
045dac59af
commit
ca1dacd621
@ -22,6 +22,7 @@ import { styleMap } from "lit-html/directives/style-map";
|
|||||||
import { fireEvent } from "../../common/dom/fire_event";
|
import { fireEvent } from "../../common/dom/fire_event";
|
||||||
import { computeRTLDirection } from "../../common/util/compute_rtl";
|
import { computeRTLDirection } from "../../common/util/compute_rtl";
|
||||||
import { debounce } from "../../common/util/debounce";
|
import { debounce } from "../../common/util/debounce";
|
||||||
|
import type { MediaPlayerItem } from "../../data/media-player";
|
||||||
import {
|
import {
|
||||||
browseLocalMediaPlayer,
|
browseLocalMediaPlayer,
|
||||||
browseMediaPlayer,
|
browseMediaPlayer,
|
||||||
@ -30,7 +31,6 @@ import {
|
|||||||
MediaPickedEvent,
|
MediaPickedEvent,
|
||||||
MediaPlayerBrowseAction,
|
MediaPlayerBrowseAction,
|
||||||
} from "../../data/media-player";
|
} from "../../data/media-player";
|
||||||
import type { MediaPlayerItem } from "../../data/media-player";
|
|
||||||
import { showAlertDialog } from "../../dialogs/generic/show-dialog-box";
|
import { showAlertDialog } from "../../dialogs/generic/show-dialog-box";
|
||||||
import { installResizeObserver } from "../../panels/lovelace/common/install-resize-observer";
|
import { installResizeObserver } from "../../panels/lovelace/common/install-resize-observer";
|
||||||
import { haStyle } from "../../resources/styles";
|
import { haStyle } from "../../resources/styles";
|
||||||
@ -480,6 +480,7 @@ export class HaMediaPlayerBrowse extends LitElement {
|
|||||||
mediaContentId?: string,
|
mediaContentId?: string,
|
||||||
mediaContentType?: string
|
mediaContentType?: string
|
||||||
): Promise<MediaPlayerItem> {
|
): Promise<MediaPlayerItem> {
|
||||||
|
this._loading = true;
|
||||||
const itemData =
|
const itemData =
|
||||||
this.entityId !== BROWSER_PLAYER
|
this.entityId !== BROWSER_PLAYER
|
||||||
? await browseMediaPlayer(
|
? await browseMediaPlayer(
|
||||||
@ -490,6 +491,7 @@ export class HaMediaPlayerBrowse extends LitElement {
|
|||||||
)
|
)
|
||||||
: await browseLocalMediaPlayer(this.hass, mediaContentId);
|
: await browseLocalMediaPlayer(this.hass, mediaContentId);
|
||||||
|
|
||||||
|
this._loading = false;
|
||||||
return itemData;
|
return itemData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -566,6 +568,13 @@ export class HaMediaPlayerBrowse extends LitElement {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ha-circular-progress {
|
||||||
|
--mdc-theme-primary: var(--primary-color);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user