From efd83eaad456ee41c900a6634f6738edff5805fa Mon Sep 17 00:00:00 2001 From: James Grugett Date: Mon, 3 Oct 2022 18:28:41 -0500 Subject: [PATCH] Home: Don't show duplicate contracts across groups --- web/pages/home/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/pages/home/index.tsx b/web/pages/home/index.tsx index a46b6d02..9e5314a5 100644 --- a/web/pages/home/index.tsx +++ b/web/pages/home/index.tsx @@ -233,14 +233,20 @@ function renderGroupSections( ) ).reverse() + const previouslySeenContracts = new Set() + return ( <> {orderedGroups.map((group) => { const contracts = groupContracts[group.slug].filter( - (c) => Math.abs(c.probChanges.day) >= 0.01 + (c) => + Math.abs(c.probChanges.day) >= 0.01 && + !previouslySeenContracts.has(c.id) ) if (contracts.length === 0) return null + contracts.forEach((c) => previouslySeenContracts.add(c.id)) + return (