aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-01-30 01:35:06 +0800
committerFabio Berger <me@fabioberger.com>2018-01-30 01:35:06 +0800
commitbb0cedd2de44a0b6533df37133ae6f576ee84b2a (patch)
tree479dfac3f965adbfc0c8b3a1591e7abf9492ff1f
parent8175c7c08575f864578d150bc9ae0800f5eaf037 (diff)
downloaddexon-sol-tools-bb0cedd2de44a0b6533df37133ae6f576ee84b2a.tar
dexon-sol-tools-bb0cedd2de44a0b6533df37133ae6f576ee84b2a.tar.gz
dexon-sol-tools-bb0cedd2de44a0b6533df37133ae6f576ee84b2a.tar.bz2
dexon-sol-tools-bb0cedd2de44a0b6533df37133ae6f576ee84b2a.tar.lz
dexon-sol-tools-bb0cedd2de44a0b6533df37133ae6f576ee84b2a.tar.xz
dexon-sol-tools-bb0cedd2de44a0b6533df37133ae6f576ee84b2a.tar.zst
dexon-sol-tools-bb0cedd2de44a0b6533df37133ae6f576ee84b2a.zip
Disallow negative amounts
-rw-r--r--packages/website/ts/components/inputs/balance_bounded_input.tsx2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/website/ts/components/inputs/balance_bounded_input.tsx b/packages/website/ts/components/inputs/balance_bounded_input.tsx
index 67d5b781e..3bbc7a5f6 100644
--- a/packages/website/ts/components/inputs/balance_bounded_input.tsx
+++ b/packages/website/ts/components/inputs/balance_bounded_input.tsx
@@ -103,7 +103,7 @@ export class BalanceBoundedInput extends React.Component<BalanceBoundedInputProp
},
() => {
const isValid = _.isUndefined(errMsg);
- if (utils.isNumeric(amountString)) {
+ if (utils.isNumeric(amountString) && !_.includes(amountString, '-')) {
this.props.onChange(isValid, new BigNumber(amountString));
} else {
this.props.onChange(isValid);