diff options
author | Leonid <logvinov.leon@gmail.com> | 2018-02-05 19:33:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-05 19:33:40 +0800 |
commit | 7b4f2b47de393b7ed6d5c264c8e80864d196180c (patch) | |
tree | 8e86af8000e0aedd7241a00c2189d8f7ca0fc2ad /packages/website/ts/components/generate_order/new_token_form.tsx | |
parent | 400a97e7a8f76d894d47368425bbe1e33fa5b255 (diff) | |
parent | c7ad6ebad6ab65a4b1e4a2084e744c6ca2bc09b8 (diff) | |
download | dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.gz dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.bz2 dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.lz dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.xz dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.zst dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.zip |
Merge branch 'development' into fix/ether_token_address
Diffstat (limited to 'packages/website/ts/components/generate_order/new_token_form.tsx')
-rw-r--r-- | packages/website/ts/components/generate_order/new_token_form.tsx | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/packages/website/ts/components/generate_order/new_token_form.tsx b/packages/website/ts/components/generate_order/new_token_form.tsx index 63645be9a..f76830a49 100644 --- a/packages/website/ts/components/generate_order/new_token_form.tsx +++ b/packages/website/ts/components/generate_order/new_token_form.tsx @@ -1,4 +1,3 @@ -import { BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; import TextField from 'material-ui/TextField'; import * as React from 'react'; @@ -7,13 +6,13 @@ import { AddressInput } from 'ts/components/inputs/address_input'; import { Alert } from 'ts/components/ui/alert'; import { LifeCycleRaisedButton } from 'ts/components/ui/lifecycle_raised_button'; import { RequiredLabel } from 'ts/components/ui/required_label'; -import { AlertTypes, Token, TokenByAddress, TokenState } from 'ts/types'; +import { AlertTypes, Token, TokenByAddress } from 'ts/types'; import { colors } from 'ts/utils/colors'; interface NewTokenFormProps { blockchain: Blockchain; tokenByAddress: TokenByAddress; - onNewTokenSubmitted: (token: Token, tokenState: TokenState) => void; + onNewTokenSubmitted: (token: Token) => void; } interface NewTokenFormState { @@ -110,13 +109,9 @@ export class NewTokenForm extends React.Component<NewTokenFormProps, NewTokenFor } let hasBalanceAllowanceErr = false; - let balance = new BigNumber(0); - let allowance = new BigNumber(0); if (doesContractExist) { try { - [balance, allowance] = await this.props.blockchain.getCurrentUserTokenBalanceAndAllowanceAsync( - this.state.address, - ); + await this.props.blockchain.getCurrentUserTokenBalanceAndAllowanceAsync(this.state.address); } catch (err) { hasBalanceAllowanceErr = true; } @@ -155,11 +150,7 @@ export class NewTokenForm extends React.Component<NewTokenFormProps, NewTokenFor isTracked: true, isRegistered: false, }; - const newTokenState: TokenState = { - balance, - allowance, - }; - this.props.onNewTokenSubmitted(newToken, newTokenState); + this.props.onNewTokenSubmitted(newToken); } private _onTokenNameChanged(e: any, name: string) { let nameErrText = ''; |