Fix popup button disabled state

This commit is contained in:
hensm
2021-04-28 08:08:51 +01:00
parent 298a833ebb
commit aa67af0be7

View File

@@ -339,8 +339,9 @@ class ReceiverEntry extends Component<ReceiverEntryProps, ReceiverEntryState> {
</div> </div>
<button className="button receiver__connect" <button className="button receiver__connect"
onClick={ this.handleCast } onClick={ this.handleCast }
disabled={ (application && application.isIdleScreen) disabled={ this.state.showAlternateAction
?? (this.props.isLoading || !this.props.canCast) }> ? !application || application.isIdleScreen
: this.props.isLoading || !this.props.canCast }>
{ this.state.isLoading { this.state.isLoading
? _("popupCastingButtonTitle" ? _("popupCastingButtonTitle"
, (this.state.isLoading , (this.state.isLoading
@@ -362,7 +363,7 @@ class ReceiverEntry extends Component<ReceiverEntryProps, ReceiverEntryState> {
const application = status.applications?.[0]; const application = status.applications?.[0];
if (!application?.isIdleScreen && this.state.showAlternateAction) { if (this.state.showAlternateAction) {
this.props.onStop(this.props.receiver); this.props.onStop(this.props.receiver);
} else { } else {
this.props.onCast(this.props.receiver); this.props.onCast(this.props.receiver);