From ab3aa0501c1bb4504f2187696a867d578d2a7d0c Mon Sep 17 00:00:00 2001 From: Baltazar Gomez Date: Fri, 29 Sep 2017 17:15:14 -0600 Subject: [PATCH] fix for empty channels #636 --- ui/js/actions/content.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ui/js/actions/content.js b/ui/js/actions/content.js index f6a5ac94b..1348c4af4 100644 --- a/ui/js/actions/content.js +++ b/ui/js/actions/content.js @@ -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, }, }); });