diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-09 03:04:16 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-11-09 03:04:16 +0800 |
commit | c27194a35783d966b27deeb1654a077b8c1ba1c8 (patch) | |
tree | 2b1deb57dcddf1c52bb7155836971be52d0b9fa3 /packages/instant/src/components/buy_button.tsx | |
parent | 6d5f65b77ede962b96ca59f30df1679a8216bd06 (diff) | |
parent | adcfe51190c8ca5cd4d11e49eb7e100c80fbd16c (diff) | |
download | dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar.gz dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar.bz2 dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar.lz dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar.xz dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar.zst dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.zip |
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/instant/prevent-css-leakage
Diffstat (limited to 'packages/instant/src/components/buy_button.tsx')
-rw-r--r-- | packages/instant/src/components/buy_button.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx index 57b3d108e..5b07e7416 100644 --- a/packages/instant/src/components/buy_button.tsx +++ b/packages/instant/src/components/buy_button.tsx @@ -16,7 +16,7 @@ import { Button } from './ui/button'; export interface BuyButtonProps { buyQuote?: BuyQuote; - assetBuyer?: AssetBuyer; + assetBuyer: AssetBuyer; affiliateInfo?: AffiliateInfo; onValidationPending: (buyQuote: BuyQuote) => void; onValidationFail: (buyQuote: BuyQuote, errorMessage: AssetBuyerError | ZeroExInstantError) => void; @@ -33,7 +33,7 @@ export class BuyButton extends React.Component<BuyButtonProps> { onBuyFailure: util.boundNoop, }; public render(): React.ReactNode { - const shouldDisableButton = _.isUndefined(this.props.buyQuote) || _.isUndefined(this.props.assetBuyer); + const shouldDisableButton = _.isUndefined(this.props.buyQuote); return ( <Button width="100%" @@ -49,11 +49,13 @@ export class BuyButton extends React.Component<BuyButtonProps> { private readonly _handleClick = async () => { // The button is disabled when there is no buy quote anyway. const { buyQuote, assetBuyer, affiliateInfo } = this.props; - if (_.isUndefined(buyQuote) || _.isUndefined(assetBuyer)) { + if (_.isUndefined(buyQuote)) { return; } this.props.onValidationPending(buyQuote); + + // TODO(bmillman): move address and balance fetching to the async state const web3Wrapper = new Web3Wrapper(assetBuyer.provider); const takerAddress = await getBestAddress(web3Wrapper); |