Skip to content

Commit

Permalink
fix: remove retry button when retry not possible (#205)
Browse files Browse the repository at this point in the history
checked if mediaInfo object exists in props.config, if it does - we renter the button.

this is done to prevent retry when it's not possible (e.g. when its offline)

when we will have event manager in the UI, we will use it to send an event to the player which will handle the retry instead of the UI.
  • Loading branch information
odedhutzler authored and Dan Ziv committed Mar 26, 2018
1 parent 337044c commit ea28008
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/components/error-overlay/error-overlay.js
Expand Up @@ -101,6 +101,26 @@ class ErrorOverlay extends BaseComponent {
}
}


/**
* render the retry button
*
* @returns {React$Element} - main state element
* @memberof ErrorOverlay
*/
renderRetryButton(): React$Element<any> | void {
if (this.props.config.mediaInfo) {
return (
<div className={style.controlButtonContainer} onClick={() => this.handleClick()}>
<button className={[style.controlButton, style.retryBtn].join(' ')}><Text id='core.retry'/></button>
</div>
)
} else {
return undefined;
}
}


/**
* render main state
*
Expand Down Expand Up @@ -146,9 +166,7 @@ class ErrorOverlay extends BaseComponent {
<div className={style.headline}>{this.props.errorHead ? this.props.errorHead :
<Text id={'error.default_error'}/>}</div>
{this.renderSessionID()}
<div className={style.controlButtonContainer} onClick={() => this.handleClick()}>
<button className={[style.controlButton, style.retryBtn].join(' ')}><Text id='core.retry'/></button>
</div>
{this.renderRetryButton()}
</div>
</Overlay>
</div>
Expand Down

0 comments on commit ea28008

Please sign in to comment.