diff --git a/js/component/file-actions.js b/js/component/file-actions.js index 7dba036e0..cc1dba546 100644 --- a/js/component/file-actions.js +++ b/js/component/file-actions.js @@ -232,6 +232,7 @@ export let FileActions = React.createClass({ return { available: true, forceShowActions: false, + fileInfo: null, } }, onShowFileActionsRowClicked: function() { @@ -239,8 +240,14 @@ export let FileActions = React.createClass({ forceShowActions: true, }); }, + onFileInfoUpdate: function(fileInfo) { + this.setState({ + fileInfo: fileInfo, + }); + }, componentDidMount: function() { this._isMounted = true; + this._fileInfoSubscribeId = lbry.fileInfoSubscribe(this.props.sdHash, this.onFileInfoUpdate); lbry.getPeersForBlobHash(this.props.sdHash, (peers) => { if (!this._isMounted) { return; @@ -255,20 +262,25 @@ export let FileActions = React.createClass({ this._isMounted = false; }, render: function() { + const fileInfo = this.state.fileInfo; + if (fileInfo === null) { + return null; + } + return ( { - this.state.available || this.state.forceShowActions ? - : - ( - This file is not currently available. - - - - - - - ) + fileInfo || this.state.available || this.state.forceShowActions + ? + : + This file is not currently available. + + + + + + + } ); } diff --git a/js/component/file-tile.js b/js/component/file-tile.js index 171fc9f5c..400be231e 100644 --- a/js/component/file-tile.js +++ b/js/component/file-tile.js @@ -113,20 +113,21 @@ export let FileTileStream = React.createClass({ return null; } - const metadata = this.props.metadata || {}, - obscureNsfw = this.props.obscureNsfw && metadata.nsfw, - title = metadata.title ? metadata.title : ('lbry://' + this.props.name); + const metadata = this.props.metadata; + const isConfirmed = typeof metadata == 'object'; + const title = isConfirmed ? metadata.title : this.props.name; + const obscureNsfw = this.props.obscureNsfw && isConfirmed && metadata.nsfw; return ( - + { !this.props.hidePrice ? : null} - lbry://{this.props.name} + {isConfirmed ? metadata.title : ('lbry://' + this.props.name)} @@ -137,7 +138,9 @@ export let FileTileStream = React.createClass({ - {metadata.description} + {isConfirmed + ? metadata.description + : This file is pending confirmation.}
- {metadata.description} + {isConfirmed + ? metadata.description + : This file is pending confirmation.}