Skip to content

Commit

Permalink
bug/1063-prevent-negative-amounts (#2589)
Browse files Browse the repository at this point in the history
* bug/1063-prevent-negative-amounts

* comment
  • Loading branch information
danielisaacgeslin authored Sep 13, 2024
1 parent 74d3659 commit e19b2cf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wormhole-connect/src/views/v2/Bridge/AmountInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ const AmountInput = (props: Props) => {
}, [isInputDisabled, tokenBalance]);

// Update token amount in local state
const onAmountChange = useCallback(
(e: any) => setAmountLocal(e.target?.value),
[],
);
const onAmountChange = useCallback((e: any) => {
if (Number(e.target?.value) < 0) return; // allows "everything" but negative numbers
setAmountLocal(e.target?.value);
}, []);

return (
<div className={classes.amountContainer}>
Expand Down

0 comments on commit e19b2cf

Please sign in to comment.