mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-10 17:49:58 +00:00
Add disabled hint to receiver selector app option (closes #139)
This commit is contained in:
@@ -13,6 +13,10 @@
|
||||
"message": "this site's app"
|
||||
, "description": "Receiver selector media type <option> text for current site's sender application."
|
||||
}
|
||||
, "popupMediaTypeAppNotFound": {
|
||||
"message": "this site's app (not found)"
|
||||
, "description": "Receiver selector media type <option> text for current site's sender application if none found."
|
||||
}
|
||||
, "popupMediaTypeAppMedia": {
|
||||
"message": "this media"
|
||||
, "description": "Receiver selector media type <option> text for media casting."
|
||||
|
||||
@@ -149,6 +149,8 @@ class PopupApp extends Component<{}, PopupAppState> {
|
||||
|
||||
const isSelectedMediaTypeAvailable =
|
||||
!!(this.state.availableMediaTypes & this.state.mediaType)
|
||||
const isAppMediaTypeAvailable = !!(this.state.availableMediaTypes
|
||||
& ReceiverSelectorMediaType.App);
|
||||
|
||||
return (
|
||||
<div>
|
||||
@@ -163,10 +165,11 @@ class PopupApp extends Component<{}, PopupAppState> {
|
||||
|
||||
<option value={ ReceiverSelectorMediaType.App }
|
||||
selected={ isAppMediaTypeSelected }
|
||||
disabled={ !(this.state.availableMediaTypes
|
||||
& ReceiverSelectorMediaType.App) }>
|
||||
disabled={ !isAppMediaTypeAvailable }>
|
||||
{ (this.state.requestedAppId && knownApps[this.state.requestedAppId]?.name)
|
||||
?? _("popupMediaTypeApp") }
|
||||
?? isAppMediaTypeAvailable
|
||||
? _("popupMediaTypeApp")
|
||||
: _("popupMediaTypeAppNotFound") }
|
||||
</option>
|
||||
|
||||
{ this.state.mirroringEnabled &&
|
||||
|
||||
Reference in New Issue
Block a user