Merge pull request #187 from lbryio/fix-api-changes

Fix pending changes to lbry.io API
This commit is contained in:
alexliebowitz 2017-02-27 17:15:00 -05:00 committed by GitHub
commit a97cd34407

View file

@ -255,7 +255,15 @@ lbry.getFeaturedDiscoverNames = function(callback) {
xhr.open('GET', 'https://api.lbry.io/discover/list', true);
xhr.onload = () => {
if (xhr.status === 200) {
resolve(JSON.parse(xhr.responseText));
var responseData = JSON.parse(xhr.responseText);
if (responseData.data) //new signature, once api.lbry.io is updated
{
resolve(responseData.data);
}
else
{
resolve(responseData);
}
} else {
reject(Error('Failed to fetch featured names.'));
}