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 => {
const claimResult = result[uri],
claims = claimResult ? claimResult.claims_in_channel : [],
currentPage = claimResult ? claimResult.returned_page : undefined;
const claimResult = result[uri] || {};
const { claims_in_channel, returned_page } = claimResult;
dispatch({
type: types.FETCH_CHANNEL_CLAIMS_COMPLETED,
data: {
uri,
claims,
page: currentPage,
claims: claims_in_channel || [],
page: returned_page,
},
});
});