Properly notify when a download times out

This commit is contained in:
Alex Liebowitz 2016-11-23 23:49:19 -05:00
parent 323cedadb2
commit 17d13c3a93

View file

@ -116,10 +116,17 @@ var DownloadLink = React.createClass({
});
} else {
lbry.getStream(this.props.streamName, (streamInfo) => {
if (typeof streamInfo !== 'object') {
this.setState({
modal: 'timedOut',
downloading: false,
});
} else {
this.setState({
modal: 'downloadStarted',
filePath: streamInfo.path,
});
}
});
}
});
@ -137,6 +144,9 @@ var DownloadLink = React.createClass({
<Modal isOpen={this.state.modal == 'notEnoughCredits'} onConfirmed={this.closeModal}>
You don't have enough LBRY credits to pay for this stream.
</Modal>
<Modal isOpen={this.state.modal == 'timedOut'} onConfirmed={this.closeModal}>
LBRY was unable to download the stream <strong>lbry://{this.props.streamName}</strong>.
</Modal>
</span>
);
}