diff --git a/web/components/bet-panel.tsx b/web/components/bet-panel.tsx index 99bb1259..677d540c 100644 --- a/web/components/bet-panel.tsx +++ b/web/components/bet-panel.tsx @@ -60,6 +60,13 @@ export function BetPanel(props: { const sharesOutcome = yesShares ? 'YES' : noShares ? 'NO' : undefined + useEffect(() => { + // Switch back to BUY if the user has sold all their shares. + if (tradeType === 'SELL' && sharesOutcome === undefined) { + setTradeType('BUY') + } + }, [tradeType, sharesOutcome]) + return (