diff --git a/src/ui/component/claimListDiscover/view.jsx b/src/ui/component/claimListDiscover/view.jsx index e4d13128a..ec50daa1f 100644 --- a/src/ui/component/claimListDiscover/view.jsx +++ b/src/ui/component/claimListDiscover/view.jsx @@ -4,6 +4,7 @@ import React, { Fragment, useEffect } from 'react'; import { withRouter } from 'react-router'; import { createNormalizedClaimSearchKey, MATURE_TAGS } from 'lbry-redux'; import { FormField } from 'component/common/form'; +import Button from 'component/button'; import moment from 'moment'; import ClaimList from 'component/claimList'; import Tag from 'component/tag'; @@ -106,16 +107,35 @@ function ClaimListDiscover(props: Props) { .unix() )}`; } - + const hasContent = + (personalSort === SEARCH_SORT_CHANNELS && subscribedChannels.length) || + (personalSort === SEARCH_SORT_YOU && !!tags.length) || + personalSort === SEARCH_SORT_ALL; const claimSearchCacheQuery = createNormalizedClaimSearchKey(options); - const uris = claimSearchByQuery[claimSearchCacheQuery] || []; + const uris = (hasContent && claimSearchByQuery[claimSearchCacheQuery]) || []; const shouldPerformSearch = - uris.length === 0 || - didNavigateForward || - (!loading && uris.length < PAGE_SIZE * page && uris.length % PAGE_SIZE === 0); + hasContent && + (uris.length === 0 || + didNavigateForward || + (!loading && uris.length < PAGE_SIZE * page && uris.length % PAGE_SIZE === 0)); // Don't use the query from createNormalizedClaimSearchKey for the effect since that doesn't include page & release_time const optionsStringForEffect = JSON.stringify(options); + const noChannels = ( +
+

{__("You're not following any channels.")}

+ {' '} + {__('or')}{' '} + +
+ ); + + const emptyState = personalSort === SEARCH_SORT_CHANNELS ? noChannels : false; + function getSearch() { let search = `?`; if (!personalView) { @@ -227,6 +247,7 @@ function ClaimListDiscover(props: Props) { onScrollBottom={handleScrollBottom} page={page} pageSize={PAGE_SIZE} + empty={emptyState} /> {loading && new Array(PAGE_SIZE).fill(1).map((x, i) => )}