fix for empty channels #636

This commit is contained in:
Baltazar Gomez 2017-09-29 17:15:14 -06:00 committed by GitHub
parent 72ad1552cb
commit ab3aa0501c

View file

@ -384,16 +384,15 @@ export function doFetchClaimsByChannel(uri, page) {
}); });
lbry.claim_list_by_channel({ uri, page: page || 1 }).then(result => { lbry.claim_list_by_channel({ uri, page: page || 1 }).then(result => {
const claimResult = result[uri], const claimResult = result[uri] || {};
claims = claimResult ? claimResult.claims_in_channel : [], const { claims_in_channel, returned_page } = claimResult;
currentPage = claimResult ? claimResult.returned_page : undefined;
dispatch({ dispatch({
type: types.FETCH_CHANNEL_CLAIMS_COMPLETED, type: types.FETCH_CHANNEL_CLAIMS_COMPLETED,
data: { data: {
uri, uri,
claims, claims: claims_in_channel || [],
page: currentPage, page: returned_page,
}, },
}); });
}); });