diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-02-08 02:27:22 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-02-08 02:27:22 +0800 |
commit | f3c6cce4559d096a2f3babfc7af670d078a6f0dd (patch) | |
tree | 580c59d474d52affc57593d25eb1d0acd480d4b0 /packages/website/ts/components/inputs/allowance_toggle.tsx | |
parent | d9b1d31e7310f7f554f1740f93e4ccd5b5db90f5 (diff) | |
parent | a26e77074fdf5ea7a754a7a676ebd752668d3c82 (diff) | |
download | dexon-sol-tools-f3c6cce4559d096a2f3babfc7af670d078a6f0dd.tar.gz dexon-sol-tools-f3c6cce4559d096a2f3babfc7af670d078a6f0dd.tar.zst dexon-sol-tools-f3c6cce4559d096a2f3babfc7af670d078a6f0dd.zip |
Merge branch 'development' into feature/testnet-faucets/queue-by-network
* development: (24 commits)
Fix Remco's github name in CODEOWNERS
Fix ABI error message
Stop using definite assignment assertion cause prettier doesn't handle that
Special-case ZRXToken snake case conversion
Fix linter errors
Generate contract wrappers on pre-build
Add missing async
Remove noImplicitThis
Tslint disable no-consecutive-blank-lines in generated files
Change compiled sources in contracts
Change utils
Change tests
Add base_contract.ts
Remove generated files
.gitignore gemerated files
Change the list of generated wrappers
Change contract templates
Add indices for index parameters so that their names don't collide
Use abi-gen for events in 0x.js
Fix artifacts path
...
Diffstat (limited to 'packages/website/ts/components/inputs/allowance_toggle.tsx')
-rw-r--r-- | packages/website/ts/components/inputs/allowance_toggle.tsx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/website/ts/components/inputs/allowance_toggle.tsx b/packages/website/ts/components/inputs/allowance_toggle.tsx index a737222ca..a2e75dfed 100644 --- a/packages/website/ts/components/inputs/allowance_toggle.tsx +++ b/packages/website/ts/components/inputs/allowance_toggle.tsx @@ -6,12 +6,14 @@ import * as ReactGA from 'react-ga'; import { Blockchain } from 'ts/blockchain'; import { Dispatcher } from 'ts/redux/dispatcher'; import { BalanceErrs, Token, TokenState } from 'ts/types'; +import { constants } from 'ts/utils/constants'; import { errorReporter } from 'ts/utils/error_reporter'; import { utils } from 'ts/utils/utils'; const DEFAULT_ALLOWANCE_AMOUNT_IN_BASE_UNITS = new BigNumber(2).pow(256).minus(1); interface AllowanceToggleProps { + networkId: number; blockchain: Blockchain; dispatcher: Dispatcher; onErrorOccurred: (errType: BalanceErrs) => void; @@ -74,12 +76,14 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow if (!this._isAllowanceSet()) { newAllowanceAmountInBaseUnits = DEFAULT_ALLOWANCE_AMOUNT_IN_BASE_UNITS; } + const networkName = constants.NETWORK_NAME_BY_ID[this.props.networkId]; + const eventLabel = `${this.props.token.symbol}-${networkName}`; try { await this.props.blockchain.setProxyAllowanceAsync(this.props.token, newAllowanceAmountInBaseUnits); ReactGA.event({ category: 'Portal', action: 'Set Allowance Success', - label: this.props.token.symbol, + label: eventLabel, value: newAllowanceAmountInBaseUnits.toNumber(), }); await this.props.refetchTokenStateAsync(); @@ -87,7 +91,7 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow ReactGA.event({ category: 'Portal', action: 'Set Allowance Failure', - label: this.props.token.symbol, + label: eventLabel, value: newAllowanceAmountInBaseUnits.toNumber(), }); this.setState({ |