Home: Don't show duplicate contracts across groups
This commit is contained in:
parent
8d70dc4800
commit
efd83eaad4
|
@ -233,14 +233,20 @@ function renderGroupSections(
|
|||
)
|
||||
).reverse()
|
||||
|
||||
const previouslySeenContracts = new Set<string>()
|
||||
|
||||
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 (
|
||||
<GroupSection
|
||||
key={group.id}
|
||||
|
|
Loading…
Reference in New Issue
Block a user