Filter out markets you sold out of from most of the views on portfolio page.
This commit is contained in:
parent
a7c422e69e
commit
a525ad82ec
|
@ -113,6 +113,13 @@ export function BetsList(props: { user: User }) {
|
|||
const displayedContracts = _.sortBy(contracts, SORTS[sort])
|
||||
.reverse()
|
||||
.filter(FILTERS[filter])
|
||||
.filter((c) => {
|
||||
if (sort === 'profit') return true
|
||||
|
||||
// Filter out contracts where you don't have shares anymore.
|
||||
const metrics = contractsMetrics[c.id]
|
||||
return metrics.payout > 0
|
||||
})
|
||||
|
||||
const [settled, unsettled] = _.partition(
|
||||
contracts,
|
||||
|
@ -226,11 +233,10 @@ function MyContractBets(props: {
|
|||
const isBinary = outcomeType === 'BINARY'
|
||||
const probPercent = getBinaryProbPercent(contract)
|
||||
|
||||
const { payout, profit, profitPercent } = getContractBetMetrics(
|
||||
const { payout, profit, profitPercent, invested } = getContractBetMetrics(
|
||||
contract,
|
||||
bets
|
||||
)
|
||||
|
||||
return (
|
||||
<div
|
||||
tabIndex={0}
|
||||
|
|
Loading…
Reference in New Issue
Block a user