fix displayed sale amount

This commit is contained in:
mantikoros 2022-01-15 16:51:09 -06:00
parent 3f42991741
commit a16d35974f

View File

@ -292,7 +292,7 @@ export function ContractBetsTable(props: {
<BetRow <BetRow
key={bet.id} key={bet.id}
bet={bet} bet={bet}
sale={salesDict[bet.id]} saleBet={salesDict[bet.id]}
contract={contract} contract={contract}
/> />
))} ))}
@ -302,8 +302,8 @@ export function ContractBetsTable(props: {
) )
} }
function BetRow(props: { bet: Bet; contract: Contract; sale?: Bet }) { function BetRow(props: { bet: Bet; contract: Contract; saleBet?: Bet }) {
const { bet, sale, contract } = props const { bet, saleBet, contract } = props
const { const {
amount, amount,
outcome, outcome,
@ -328,8 +328,8 @@ function BetRow(props: { bet: Bet; contract: Contract; sale?: Bet }) {
</td> </td>
<td>{formatWithCommas(shares)}</td> <td>{formatWithCommas(shares)}</td>
<td> <td>
{sale ? ( {saleBet?.sale ? (
<>{formatMoney(Math.abs(sale.amount))} (sold)</> <>{formatMoney(Math.abs(saleBet.sale.amount))} (sold)</>
) : ( ) : (
formatMoney( formatMoney(
isResolved isResolved