Use new lbry.getCostInfoForName() in DownloadLink and WatchLink

This commit is contained in:
Alex Liebowitz 2016-12-16 17:56:53 -05:00
parent 500ea38792
commit 7efbccbe83

View file

@ -113,9 +113,9 @@ export let DownloadLink = React.createClass({
downloading: true downloading: true
}); });
lbry.getCostEstimate(this.props.streamName, (amount) => { lbry.getCostInfoForName(this.props.streamName, ({cost}) => {
lbry.getBalance((balance) => { lbry.getBalance((balance) => {
if (amount > balance) { if (cost > balance) {
this.setState({ this.setState({
modal: 'notEnoughCredits', modal: 'notEnoughCredits',
downloading: false downloading: false
@ -172,9 +172,9 @@ export let WatchLink = React.createClass({
this.setState({ this.setState({
loading: true, loading: true,
}) })
lbry.getCostEstimate(this.props.streamName, (amount) => { lbry.getCostInfoForName(this.props.streamName, ({cost}) => {
lbry.getBalance((balance) => { lbry.getBalance((balance) => {
if (amount > balance) { if (cost > balance) {
this.setState({ this.setState({
modal: 'notEnoughCredits', modal: 'notEnoughCredits',
loading: false, loading: false,