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 =
claimSearchResult === undefined ||
didNavigateForward ||
(!loading &&
!claimSearchResultLastPageReached &&
claimSearchResult &&
claimSearchResult.length &&
claimSearchResult.length < dynamicPageSize * options.page &&
claimSearchResult.length % dynamicPageSize === 0);
!uris &&
(claimSearchResult === undefined ||
didNavigateForward ||
(!loading &&
!claimSearchResultLastPageReached &&
claimSearchResult &&
claimSearchResult.length &&
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
const optionsStringForEffect = JSON.stringify(options);