From 4a5e967628552c1626f809803704f539bdecaca2 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Fri, 4 Mar 2022 19:44:58 +0800 Subject: [PATCH] Recommended: fix "no results found" flashing after search ## Cause When 'selectRecommendedContentForUri' is filtering results against the blocklist, it relies on claim data which could be unresolved yet. It filters to empty results for this scenario, hence the flashing message. ## Change Just return raw results when claims are not resolved yet, so that the GUI knows it needs to show the placeholders while resolving. After resolving, it'll go through the blocklist filtering again. --- ui/redux/selectors/search.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/redux/selectors/search.js b/ui/redux/selectors/search.js index 2cf4b9231..929e0e2b5 100644 --- a/ui/redux/selectors/search.js +++ b/ui/redux/selectors/search.js @@ -101,7 +101,9 @@ export const selectRecommendedContentForUri = createCachedSelector( recommendedContent = searchResult['uris'].filter((searchUri) => { const searchClaim = claimsByUri[searchUri]; - if (!searchClaim) return; + if (!searchClaim) { + return true; + } const signingChannel = searchClaim && searchClaim.signing_channel; const channelUri = signingChannel && signingChannel.canonical_url;