ClaimListDiscover: if 'uris' is given, there is no need to perform a search

This was causing unnecessary calls that won't be used.
This commit is contained in:
infinite-persistence 2022-02-25 12:48:00 +08:00 committed by Thomas Zarebczan
parent 99d8d0dbee
commit 3974ca6322

View file

@ -465,14 +465,15 @@ function ClaimListDiscover(props: Props) {
} }
const shouldPerformSearch = const shouldPerformSearch =
claimSearchResult === undefined || !uris &&
didNavigateForward || (claimSearchResult === undefined ||
(!loading && didNavigateForward ||
!claimSearchResultLastPageReached && (!loading &&
claimSearchResult && !claimSearchResultLastPageReached &&
claimSearchResult.length && claimSearchResult &&
claimSearchResult.length < dynamicPageSize * options.page && claimSearchResult.length &&
claimSearchResult.length % dynamicPageSize === 0); claimSearchResult.length < dynamicPageSize * options.page &&
claimSearchResult.length % dynamicPageSize === 0));
// Don't use the query from createNormalizedClaimSearchKey for the effect since that doesn't include page & release_time // Don't use the query from createNormalizedClaimSearchKey for the effect since that doesn't include page & release_time
const optionsStringForEffect = JSON.stringify(options); const optionsStringForEffect = JSON.stringify(options);