diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-20 04:42:42 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-20 04:42:42 +0800 |
commit | 17b282b1d743c83a4a4378eb71df098949569bdd (patch) | |
tree | 9906016f23e746421a626277827d9fae2d20d390 /packages/instant/src/components/buy_button.tsx | |
parent | 48dd9569f7d8dac398c4af629c6efa2738aec285 (diff) | |
download | dexon-0x-contracts-17b282b1d743c83a4a4378eb71df098949569bdd.tar dexon-0x-contracts-17b282b1d743c83a4a4378eb71df098949569bdd.tar.gz dexon-0x-contracts-17b282b1d743c83a4a4378eb71df098949569bdd.tar.bz2 dexon-0x-contracts-17b282b1d743c83a4a4378eb71df098949569bdd.tar.lz dexon-0x-contracts-17b282b1d743c83a4a4378eb71df098949569bdd.tar.xz dexon-0x-contracts-17b282b1d743c83a4a4378eb71df098949569bdd.tar.zst dexon-0x-contracts-17b282b1d743c83a4a4378eb71df098949569bdd.zip |
wip: retry button
Diffstat (limited to 'packages/instant/src/components/buy_button.tsx')
-rw-r--r-- | packages/instant/src/components/buy_button.tsx | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx index 3ef7c1f5c..4d2386620 100644 --- a/packages/instant/src/components/buy_button.tsx +++ b/packages/instant/src/components/buy_button.tsx @@ -24,15 +24,14 @@ export class BuyButton extends React.Component<BuyButtonProps> { onBuyFailure: util.boundNoop, }; public render(): React.ReactNode { + // TODO: move container out const shouldDisableButton = _.isUndefined(this.props.buyQuote); return ( - <Container padding="20px" width="100%"> - <Button width="100%" onClick={this._handleClick} isDisabled={shouldDisableButton}> - <Text fontColor={ColorOption.white} fontWeight={600} fontSize="20px"> - {this.props.text} - </Text> - </Button> - </Container> + <Button width="100%" onClick={this._handleClick} isDisabled={shouldDisableButton}> + <Text fontColor={ColorOption.white} fontWeight={600} fontSize="20px"> + {this.props.text} + </Text> + </Button> ); } private readonly _handleClick = async () => { @@ -43,10 +42,13 @@ export class BuyButton extends React.Component<BuyButtonProps> { this.props.onClick(this.props.buyQuote); let txnHash; try { - txnHash = await this.props.assetBuyer.executeBuyQuoteAsync(this.props.buyQuote); + txnHash = await this.props.assetBuyer.executeBuyQuoteAsync(this.props.buyQuote, { + gasLimit: 5000000, + }); await web3Wrapper.awaitTransactionSuccessAsync(txnHash); this.props.onBuySuccess(this.props.buyQuote, txnHash); - } catch { + } catch (e) { + console.log('error', e); this.props.onBuyFailure(this.props.buyQuote, txnHash); } }; |