Properly notify when a download times out
This commit is contained in:
parent
323cedadb2
commit
17d13c3a93
1 changed files with 14 additions and 4 deletions
|
@ -116,10 +116,17 @@ var DownloadLink = React.createClass({
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
lbry.getStream(this.props.streamName, (streamInfo) => {
|
lbry.getStream(this.props.streamName, (streamInfo) => {
|
||||||
this.setState({
|
if (typeof streamInfo !== 'object') {
|
||||||
modal: 'downloadStarted',
|
this.setState({
|
||||||
filePath: streamInfo.path,
|
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}>
|
<Modal isOpen={this.state.modal == 'notEnoughCredits'} onConfirmed={this.closeModal}>
|
||||||
You don't have enough LBRY credits to pay for this stream.
|
You don't have enough LBRY credits to pay for this stream.
|
||||||
</Modal>
|
</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>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue