diff --git a/web/components/bet-panel.tsx b/web/components/bet-panel.tsx index dadf6516..a48eaa65 100644 --- a/web/components/bet-panel.tsx +++ b/web/components/bet-panel.tsx @@ -423,13 +423,18 @@ function RangeOrderPanel(props: { const [isSubmitting, setIsSubmitting] = useState(false) const [wasSubmitted, setWasSubmitted] = useState(false) + const rangeError = + lowLimitProb !== undefined && + highLimitProb !== undefined && + lowLimitProb >= highLimitProb + function onBetChange(newAmount: number | undefined) { setWasSubmitted(false) setBetAmount(newAmount) } async function submitBet() { - if (!user || !betAmount) return + if (!user || !betAmount || rangeError) return const limitProbScaled = lowLimitProb !== undefined ? lowLimitProb / 100 : undefined @@ -474,7 +479,7 @@ function RangeOrderPanel(props: { }) } - const betDisabled = isSubmitting || !betAmount || error + const betDisabled = isSubmitting || !betAmount || rangeError || error const lowProbFrac = (lowLimitProb ?? initialProb * 100) / 100 const { @@ -507,8 +512,8 @@ function RangeOrderPanel(props: { return ( <>
- Trigger when the {isPseudoNumeric ? 'value' : 'probability'} reaches low - or high limit. + Bet only when the {isPseudoNumeric ? 'value' : 'probability'} reaches + low or high limit.
@@ -534,6 +539,12 @@ function RangeOrderPanel(props: { + {rangeError && ( +
+ Low limit must be less than high limit +
+ )} +
Max amount*