ClaimListDiscover: fix broken excludeUris logic

This commit is contained in:
infinite-persistence 2022-03-30 09:17:26 +08:00 committed by Thomas Zarebczan
parent 8823461ebd
commit cc8812d751

View file

@ -526,7 +526,7 @@ function ClaimListDiscover(props: Props) {
// --- direct uris // --- direct uris
finalUris = uris; finalUris = uris;
injectPinUrls(finalUris, orderParam, pins); injectPinUrls(finalUris, orderParam, pins);
filterExcludedUris(finalUris, excludeUris); finalUris = filterExcludedUris(finalUris, excludeUris);
} else { } else {
// --- searched uris // --- searched uris
if (isUnfetchedClaimSearch && prevUris.current) { if (isUnfetchedClaimSearch && prevUris.current) {
@ -534,7 +534,7 @@ function ClaimListDiscover(props: Props) {
} else { } else {
finalUris = claimSearchResult; finalUris = claimSearchResult;
injectPinUrls(finalUris, orderParam, pins); injectPinUrls(finalUris, orderParam, pins);
filterExcludedUris(finalUris, excludeUris); finalUris = filterExcludedUris(finalUris, excludeUris);
prevUris.current = finalUris; prevUris.current = finalUris;
} }
} }
@ -632,8 +632,9 @@ function ClaimListDiscover(props: Props) {
function filterExcludedUris(uris, excludeUris) { function filterExcludedUris(uris, excludeUris) {
if (uris && excludeUris && excludeUris.length) { if (uris && excludeUris && excludeUris.length) {
uris = uris.filter((uri) => !excludeUris.includes(uri)); return uris.filter((uri) => !excludeUris.includes(uri));
} }
return uris;
} }
// ************************************************************************** // **************************************************************************