From 098f20ccad23d81ffc8f90703bfa43a7112cc12d Mon Sep 17 00:00:00 2001 From: James Grugett Date: Sun, 10 Jul 2022 22:28:29 -0500 Subject: [PATCH] Fix limit bet filter to exclude cancelled and filled bets --- web/components/bets-list.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/components/bets-list.tsx b/web/components/bets-list.tsx index 2a7da76e..d5e64c46 100644 --- a/web/components/bets-list.tsx +++ b/web/components/bets-list.tsx @@ -132,7 +132,9 @@ export function BetsList(props: { if (filter === 'sold') return !hasShares if (filter === 'limit_bet') - return (contractBets[c.id] ?? []).some((b) => b.limitProb !== undefined) + return (contractBets[c.id] ?? []).some( + (b) => b.limitProb !== undefined && !b.isCancelled && !b.isFilled + ) return hasShares }) const displayedContracts = filteredContracts.slice(start, end) @@ -262,7 +264,7 @@ function ContractBets(props: { const { resolution, outcomeType } = contract const limitBets = bets.filter( - (bet) => bet.limitProb !== undefined + (bet) => bet.limitProb !== undefined && !bet.isCancelled && !bet.isFilled ) as LimitBet[] const resolutionValue = (contract as NumericContract).resolutionValue