fix pending changes to api.lbry.io

This commit is contained in:
Jeremy Kauffman 2017-02-23 17:29:52 -05:00 committed by Alex Liebowitz
parent ae4a27c122
commit 7eb15a9ac6

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));
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.'));
}