Home: Don't show duplicate contracts across groups
This commit is contained in:
parent
8d70dc4800
commit
efd83eaad4
|
@ -233,14 +233,20 @@ function renderGroupSections(
|
||||||
)
|
)
|
||||||
).reverse()
|
).reverse()
|
||||||
|
|
||||||
|
const previouslySeenContracts = new Set<string>()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{orderedGroups.map((group) => {
|
{orderedGroups.map((group) => {
|
||||||
const contracts = groupContracts[group.slug].filter(
|
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
|
if (contracts.length === 0) return null
|
||||||
|
|
||||||
|
contracts.forEach((c) => previouslySeenContracts.add(c.id))
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<GroupSection
|
<GroupSection
|
||||||
key={group.id}
|
key={group.id}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user