From a2328587d008d1c1149cde8c5896fa3d523cfc28 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Mon, 28 Mar 2022 23:36:11 -0500 Subject: [PATCH] Fixes from Stephen's review --- web/components/amount-input.tsx | 2 +- web/components/bet-panel.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/components/amount-input.tsx b/web/components/amount-input.tsx index ff6af9fe..6c42a370 100644 --- a/web/components/amount-input.tsx +++ b/web/components/amount-input.tsx @@ -250,7 +250,7 @@ export function SellAmountInput(props: { Sale proceeds{' '} {formatMoney(saleValue)} - {prevLoanAmount && ( + {!!prevLoanAmount && ( Loan repaid{' '} diff --git a/web/components/bet-panel.tsx b/web/components/bet-panel.tsx index 009bf1dc..075439b8 100644 --- a/web/components/bet-panel.tsx +++ b/web/components/bet-panel.tsx @@ -364,7 +364,7 @@ function SellPanel(props: { const initialProb = getProbability(contract) const { newPool } = calculateCpmmSale(contract, { - shares: amount ?? 0, + shares: Math.min(amount ?? 0, shares), outcome: sharesOutcome, }) const resultProb = getCpmmProbability(newPool, contract.p)