prevents content on tags or channels sort if param empty

This commit is contained in:
jessop 2019-08-09 13:29:00 -04:00
parent 929b00aefa
commit 08b019ae5f

View file

@ -108,14 +108,16 @@ function ClaimListDiscover(props: Props) {
}
const hasContent =
(personalSort === SEARCH_SORT_CHANNELS && subscribedChannels.length) ||
(personalSort === SEARCH_SORT_YOU && !!tags.length);
(personalSort === SEARCH_SORT_YOU && !!tags.length) ||
personalSort === SEARCH_SORT_ALL;
console.log('has content', String(hasContent));
const claimSearchCacheQuery = createNormalizedClaimSearchKey(options);
const uris = claimSearchByQuery[claimSearchCacheQuery] || [];
const uris = (hasContent && claimSearchByQuery[claimSearchCacheQuery]) || [];
const shouldPerformSearch =
uris.length === 0 ||
hasContent &&
(uris.length === 0 ||
didNavigateForward ||
(!loading && uris.length < PAGE_SIZE * page && uris.length % PAGE_SIZE === 0);
(!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);