Hide cast buttons when no media types are available

This commit is contained in:
hensm
2022-08-24 06:18:35 +01:00
parent 119f50521e
commit 33eb76b84d
2 changed files with 7 additions and 3 deletions

View File

@@ -171,8 +171,8 @@
if (browserWindow?.id === undefined) return;
browser.windows.update(browserWindow.id, {
height: Math.ceil(
(document.body.clientHeight +
(window.outerHeight - window.innerHeight))
document.body.clientHeight +
(window.outerHeight - window.innerHeight)
)
});
}
@@ -417,6 +417,8 @@
{port}
{device}
{isMediaTypeAvailable}
isAnyMediaTypeAvailable={availableMediaTypes !==
ReceiverSelectorMediaType.None}
isAnyConnecting={isConnecting}
on:cast={ev => onReceiverCast(ev.detail.device)}
on:stop={ev => onReceiverStop(ev.detail.device)}

View File

@@ -23,6 +23,8 @@
export let isAnyConnecting: boolean;
/** Whether the selected media type is available for this receiver. */
export let isMediaTypeAvailable: boolean;
/** Whether any media types are available for this receiver. */
export let isAnyMediaTypeAvailable: boolean;
/** Receiver device to display. */
export let device: ReceiverDevice;
@@ -98,7 +100,7 @@
>
{_("popupStopButtonTitle")}
</button>
{:else}
{:else if isAnyMediaTypeAvailable}
<button
class="receiver__cast-button"
disabled={isConnecting || isAnyConnecting || !isMediaTypeAvailable}