aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components
diff options
context:
space:
mode:
authorSteve Klebanoff <steve@0xproject.com>2018-12-05 09:26:04 +0800
committerGitHub <noreply@github.com>2018-12-05 09:26:04 +0800
commit9aff0dfed0035dbfe50632b2861063547c5b49ec (patch)
tree59faa79626492cab7c3e8df3fa5e3fe6ddfbcd88 /packages/instant/src/components
parent4e7031e96d9f3b6548abfc58d06e94ebde102bcf (diff)
parent0af1bf11c86361010fa741541244a9e76674bccf (diff)
downloaddexon-sol-tools-9aff0dfed0035dbfe50632b2861063547c5b49ec.tar
dexon-sol-tools-9aff0dfed0035dbfe50632b2861063547c5b49ec.tar.gz
dexon-sol-tools-9aff0dfed0035dbfe50632b2861063547c5b49ec.tar.bz2
dexon-sol-tools-9aff0dfed0035dbfe50632b2861063547c5b49ec.tar.lz
dexon-sol-tools-9aff0dfed0035dbfe50632b2861063547c5b49ec.tar.xz
dexon-sol-tools-9aff0dfed0035dbfe50632b2861063547c5b49ec.tar.zst
dexon-sol-tools-9aff0dfed0035dbfe50632b2861063547c5b49ec.zip
Merge pull request #1381 from 0xProject/feature/magic-input-error
[instant] Magic input to trigger error for production Rollbar testing
Diffstat (limited to 'packages/instant/src/components')
-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..86aca5a65 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 { GIT_SHA, MAGIC_TRIGGER_ERROR_INPUT, MAGIC_TRIGGER_ERROR_MESSAGE, NPM_PACKAGE_VERSION } 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(`${MAGIC_TRIGGER_ERROR_MESSAGE} git: ${GIT_SHA}, npm: ${NPM_PACKAGE_VERSION}`);
+ }
+
const sanitizedValue = event.target.value.replace(/[^0-9.]/g, ''); // only allow numbers and "."
this.setState({
stringValue: sanitizedValue,