Skip to content

Commit 31fa866

Browse files
committed
feat: enforce toggle value
1 parent eace09e commit 31fa866

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/frontend/src/components/Lp/MintAndLp/LpSettings.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ const LpSettings: React.FC<{ onComplete: () => void; squeethToMint: string }> =
147147
const collatRatioVal = new BigNumber(collatRatio).div(100).toNumber()
148148
const slippageAmountVal = new BigNumber(slippageAmount).div(100).toNumber()
149149

150+
const handleUniswapNftAsCollatToggle = (value: any) => {
151+
if (value !== null) {
152+
setUsingUniswapNftAsCollat(value)
153+
}
154+
}
155+
150156
useAppEffect(() => {
151157
if (usingDefaultPriceRange) {
152158
setLowerTick(TickMath.MIN_TICK)
@@ -285,9 +291,9 @@ const LpSettings: React.FC<{ onComplete: () => void; squeethToMint: string }> =
285291

286292
<ToggleButtonGroup
287293
size="medium"
288-
value={usingUniswapNftAsCollat}
289-
onChange={(e, value) => setUsingUniswapNftAsCollat(value)}
290294
exclusive
295+
value={usingUniswapNftAsCollat}
296+
onChange={(event, value) => handleUniswapNftAsCollatToggle(value)}
291297
>
292298
<ToggleButton classes={toggleButtonClasses} value={true}>
293299
Yes

0 commit comments

Comments
 (0)