diff --git a/js/component/file-actions.js b/js/component/file-actions.js index cc1dba546..b2a8ff790 100644 --- a/js/component/file-actions.js +++ b/js/component/file-actions.js @@ -248,13 +248,13 @@ export let FileActions = React.createClass({ componentDidMount: function() { this._isMounted = true; this._fileInfoSubscribeId = lbry.fileInfoSubscribe(this.props.sdHash, this.onFileInfoUpdate); - lbry.getPeersForBlobHash(this.props.sdHash, (peers) => { + lbry.getStreamAvailability(this.props.streamName, (availability) => { if (!this._isMounted) { return; } this.setState({ - available: peers.length > 0, + available: availability > 0, }); }); }, diff --git a/js/lbry.js b/js/lbry.js index 088bccf9a..c55927714 100644 --- a/js/lbry.js +++ b/js/lbry.js @@ -207,6 +207,10 @@ lbry.getPeersForBlobHash = function(blobHash, callback) { }); } +lbry.getStreamAvailability = function(name, callback) { + lbry.call('get_availability', {name: name}, callback); +} + lbry.getCostInfoForName = function(name, callback, errorCallback) { /** * Takes a LBRY name; will first try and calculate a total cost using