From 5a39ca4c5e946e36fbff92eb624b5a0f6f58c0a4 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Mon, 28 Feb 2022 16:44:25 -0800 Subject: [PATCH] Don't show payout if chosen column for resolved markets --- web/components/bets-list.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/web/components/bets-list.tsx b/web/components/bets-list.tsx index 735d314e..4638435e 100644 --- a/web/components/bets-list.tsx +++ b/web/components/bets-list.tsx @@ -425,7 +425,7 @@ export function ContractBetsTable(props: { Outcome Amount {isResolved ? <>Payout : <>Sale price} - Payout if chosen + {!isResolved && Payout if chosen} Probability Shares Date @@ -476,7 +476,10 @@ function BetRow(props: { bet: Bet; contract: Contract; saleBet?: Bet }) { ) ) - const payoutIfChosen = calculatePayout(contract, bet, bet.outcome) + const payoutIfChosenDisplay = + bet.outcome === '0' && bet.isAnte + ? 'N/A' + : formatMoney(calculatePayout(contract, bet, bet.outcome)) return ( @@ -490,7 +493,7 @@ function BetRow(props: { bet: Bet; contract: Contract; saleBet?: Bet }) { {formatMoney(amount)} {saleDisplay} - {formatMoney(payoutIfChosen)} + {!isResolved && {payoutIfChosenDisplay}} {formatPercent(probBefore)} → {formatPercent(probAfter)}