Subtract loan amount from investment

This commit is contained in:
James Grugett 2022-03-21 01:29:53 -05:00
parent 03592f9c3e
commit 0592909248

View File

@ -91,7 +91,7 @@ export function BetsList(props: { user: User }) {
const contractsInvestment = _.mapValues(contractBets, (bets) => {
return _.sumBy(bets, (bet) => {
if (bet.isSold || bet.sale) return 0
return bet.amount
return bet.amount - (bet.loanAmount ?? 0)
})
})