aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/scaling_amount_input.tsx
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-12-05 07:58:36 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-12-05 07:58:36 +0800
commit1cc043d7a9d2c7bbdfc6b692ca30b8af8d6b8606 (patch)
tree923608602f96e5d3b75180c150a259a61b360747 /packages/instant/src/components/scaling_amount_input.tsx
parent1b4c477ddb13d5d305f3a607e3b3c837d143b311 (diff)
downloaddexon-sol-tools-1cc043d7a9d2c7bbdfc6b692ca30b8af8d6b8606.tar.gz
dexon-sol-tools-1cc043d7a9d2c7bbdfc6b692ca30b8af8d6b8606.tar.zst
dexon-sol-tools-1cc043d7a9d2c7bbdfc6b692ca30b8af8d6b8606.zip
feat(instant): input to trigger error for rollbar testing
Diffstat (limited to 'packages/instant/src/components/scaling_amount_input.tsx')
-rw-r--r--packages/instant/src/components/scaling_amount_input.tsx5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/instant/src/components/scaling_amount_input.tsx b/packages/instant/src/components/scaling_amount_input.tsx
index 0861bbe05..f95020461 100644
--- a/packages/instant/src/components/scaling_amount_input.tsx
+++ b/packages/instant/src/components/scaling_amount_input.tsx
@@ -4,6 +4,7 @@ import * as React from 'react';
import { Maybe } from '../types';
+import { MAGIC_TRIGGER_ERROR_INPUT } from '../constants';
import { ColorOption } from '../style/theme';
import { maybeBigNumberUtil } from '../util/maybe_big_number';
import { util } from '../util/util';
@@ -71,6 +72,10 @@ export class ScalingAmountInput extends React.Component<ScalingAmountInputProps,
);
}
private readonly _handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {
+ if (event.target.value === MAGIC_TRIGGER_ERROR_INPUT) {
+ throw new Error('Triggered error');
+ }
+
const sanitizedValue = event.target.value.replace(/[^0-9.]/g, ''); // only allow numbers and "."
this.setState({
stringValue: sanitizedValue,