Fix limit bet filter to exclude cancelled and filled bets
This commit is contained in:
parent
89d48d6c34
commit
098f20ccad
|
@ -132,7 +132,9 @@ export function BetsList(props: {
|
||||||
|
|
||||||
if (filter === 'sold') return !hasShares
|
if (filter === 'sold') return !hasShares
|
||||||
if (filter === 'limit_bet')
|
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
|
return hasShares
|
||||||
})
|
})
|
||||||
const displayedContracts = filteredContracts.slice(start, end)
|
const displayedContracts = filteredContracts.slice(start, end)
|
||||||
|
@ -262,7 +264,7 @@ function ContractBets(props: {
|
||||||
const { resolution, outcomeType } = contract
|
const { resolution, outcomeType } = contract
|
||||||
|
|
||||||
const limitBets = bets.filter(
|
const limitBets = bets.filter(
|
||||||
(bet) => bet.limitProb !== undefined
|
(bet) => bet.limitProb !== undefined && !bet.isCancelled && !bet.isFilled
|
||||||
) as LimitBet[]
|
) as LimitBet[]
|
||||||
const resolutionValue = (contract as NumericContract).resolutionValue
|
const resolutionValue = (contract as NumericContract).resolutionValue
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user