From 6eb2fba279b6d930507d745b7b5b9b292ea44bee Mon Sep 17 00:00:00 2001 From: Daniel Bachler Date: Thu, 2 Nov 2023 17:09:24 +0100 Subject: [PATCH] :hammer: fix filter query --- site/DataPageV2Content.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/site/DataPageV2Content.tsx b/site/DataPageV2Content.tsx index 3919201bf7b..72839e2ec87 100644 --- a/site/DataPageV2Content.tsx +++ b/site/DataPageV2Content.tsx @@ -154,9 +154,13 @@ export const DataPageV2Content = ({ const relatedResearch = relatedResearchCandidates.length > 10 && datapageData.topicTagsLinks?.length - ? relatedResearchCandidates.filter((research) => - intersection([research.tags, datapageData.topicTagsLinks]) - ) + ? relatedResearchCandidates.filter((research) => { + const shared = intersection( + research.tags, + datapageData.topicTagsLinks ?? [] + ) + return shared.length > 0 + }) : relatedResearchCandidates // TODO: mark topic pages