Merge pull request #13 from lbryio/fix-watch

Update Watch logic for new API wrapper
This commit is contained in:
alexliebowitz 2017-03-14 12:34:17 -04:00 committed by GitHub
commit b13381e9aa
2 changed files with 5 additions and 5 deletions

View file

@ -18,7 +18,7 @@ Web UI version numbers should always match the corresponding version of LBRY App
*
### Fixed
*
* Fix Watch page and progress bars for new API changes
*
*

View file

@ -27,7 +27,7 @@ var WatchPage = React.createClass({
};
},
componentDidMount: function() {
lbry.get({name: this.props.name}, (fileInfo) => {
lbry.get({name: this.props.name}).then((fileInfo) => {
this._outpoint = fileInfo.outpoint;
this.updateLoadStatus();
});
@ -67,11 +67,11 @@ var WatchPage = React.createClass({
}
},
updateLoadStatus: function() {
api.file_list({
lbry.file_list({
outpoint: this._outpoint,
full_status: true,
}, ([status]) => {
if (!status || !['running', 'stopped'].includes(status.code) || status.written_bytes == 0) {
}).then(([status]) => {
if (!status || status.written_bytes == 0) {
// Download hasn't started yet, so update status message (if available) then try again
// TODO: Would be nice to check if we have the MOOV before starting playing
if (status) {