From 9e3dc5b5ce970e6a74d0c47f410f99c50163e043 Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Sat, 24 Sep 2016 02:50:13 -0400 Subject: [PATCH] Convert MyFilesPage._filesOwnershipLoaded to state var --- js/page/my_files.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/js/page/my_files.js b/js/page/my_files.js index b0b54545a..bbf9dd7ea 100644 --- a/js/page/my_files.js +++ b/js/page/my_files.js @@ -135,11 +135,11 @@ var MyFilesPage = React.createClass({ _fileTimeout: null, _fileInfoCheckNum: 0, _filesOwnership: {}, - _filesOwnershipLoaded: false, getInitialState: function() { return { filesInfo: null, + filesOwnershipLoaded: false, filesAvailable: {}, }; }, @@ -170,13 +170,17 @@ var MyFilesPage = React.createClass({ this._filesOwnership[fileInfo.lbry_uri] = false; ownershipLoadedCount++; if (ownershipLoadedCount >= filesInfo.length) { - this._filesOwnershipLoaded = true; + this.setState({ + filesOwnershipLoaded: true, + }); } }, (err) => { this._filesOwnership[fileInfo.lbry_uri] = true; ownershipLoadedCount++; if (ownershipLoadedCount >= filesInfo.length) { - this._filesOwnershipLoaded = true; + this.setState({ + filesOwnershipLoaded: true, + }); } }); } @@ -220,7 +224,7 @@ var MyFilesPage = React.createClass({ }); }, render: function() { - if (this.state.filesInfo === null || !this._filesOwnershipLoaded) { + if (this.state.filesInfo === null || !this.state.filesOwnershipLoaded) { return (