whoops
This commit is contained in:
parent
f7a8fad48b
commit
de974e8725
1 changed files with 5 additions and 5 deletions
|
@ -39,7 +39,7 @@ function ClaimTilesDiscover(props: Props) {
|
|||
claimType,
|
||||
timestamp,
|
||||
} = props;
|
||||
const [hasSearched, setHasSearched] = React.useState(false);
|
||||
// const [hasSearched, setHasSearched] = React.useState(false);
|
||||
|
||||
const options: {
|
||||
page_size: number,
|
||||
|
@ -78,7 +78,7 @@ function ClaimTilesDiscover(props: Props) {
|
|||
|
||||
const claimSearchCacheQuery = createNormalizedClaimSearchKey(options);
|
||||
const uris = claimSearchByQuery[claimSearchCacheQuery] || [];
|
||||
const shouldPerformSearch = (!hasSearched && uris.length === 0) || (!loading && uris.length < pageSize);
|
||||
const shouldPerformSearch = uris.length === 0 || (!loading && uris.length < pageSize);
|
||||
// Don't use the query from createNormalizedClaimSearchKey for the effect since that doesn't include page & release_time
|
||||
const optionsStringForEffect = JSON.stringify(options);
|
||||
|
||||
|
@ -86,13 +86,13 @@ function ClaimTilesDiscover(props: Props) {
|
|||
if (shouldPerformSearch) {
|
||||
const searchOptions = JSON.parse(optionsStringForEffect);
|
||||
doClaimSearch(searchOptions);
|
||||
setHasSearched(true);
|
||||
// setHasSearched(true);
|
||||
}
|
||||
|
||||
return () => {
|
||||
setHasSearched(false);
|
||||
// setHasSearched(false);
|
||||
};
|
||||
}, [doClaimSearch, shouldPerformSearch, optionsStringForEffect, setHasSearched]);
|
||||
}, [doClaimSearch, shouldPerformSearch, optionsStringForEffect]);
|
||||
|
||||
return (
|
||||
<ul className="claim-grid">
|
||||
|
|
Loading…
Reference in a new issue