On My Files page, simplify check for file availability

This commit is contained in:
Alex Liebowitz 2016-09-24 02:41:53 -04:00
parent 8bc13fb8a5
commit e5e27444a5

View file

@ -197,12 +197,7 @@ var MyFilesPage = React.createClass({
lbry.search(name, (results) => {
var result = results[0];
if (result.name != name) {
// File not listed in Lighthouse
var available = false;
} else {
var available = result.available;
}
var available = result.name == name && result.available;
if (typeof this.state.filesAvailable[name] === 'undefined' || available != this.state.filesAvailable[name]) {
var newFilesAvailable = Object.assign({}, this.state.filesAvailable);