aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-12-16 01:05:53 +0800
committerFabio Berger <me@fabioberger.com>2017-12-16 01:05:53 +0800
commit94f40a54b42d467d9588862e11b2be45eb8f232c (patch)
treeacd89e4cc42af5eeb63b9d85649125d2f8f60c2d
parentac1fbeb9623682ce678990d1815fcff63a6c40ae (diff)
downloaddexon-sol-tools-94f40a54b42d467d9588862e11b2be45eb8f232c.tar.gz
dexon-sol-tools-94f40a54b42d467d9588862e11b2be45eb8f232c.tar.zst
dexon-sol-tools-94f40a54b42d467d9588862e11b2be45eb8f232c.zip
Add default value for onConversionSuccessful
-rw-r--r--packages/website/ts/components/eth_weth_conversion_button.tsx5
1 files changed, 2 insertions, 3 deletions
diff --git a/packages/website/ts/components/eth_weth_conversion_button.tsx b/packages/website/ts/components/eth_weth_conversion_button.tsx
index bf686d44b..b017de27b 100644
--- a/packages/website/ts/components/eth_weth_conversion_button.tsx
+++ b/packages/website/ts/components/eth_weth_conversion_button.tsx
@@ -32,6 +32,7 @@ export class EthWethConversionButton extends
React.Component<EthWethConversionButtonProps, EthWethConversionButtonState> {
public static defaultProps: Partial<EthWethConversionButtonProps> = {
isDisabled: false,
+ onConversionSuccessful: _.noop,
};
public constructor(props: EthWethConversionButtonProps) {
super(props);
@@ -100,9 +101,7 @@ export class EthWethConversionButton extends
if (!this.props.isOutdatedWrappedEther) {
this.props.dispatcher.replaceTokenBalanceByAddress(token.address, balance);
}
- if (!_.isUndefined(this.props.onConversionSuccessful)) {
- this.props.onConversionSuccessful();
- }
+ this.props.onConversionSuccessful();
} catch (err) {
const errMsg = '' + err;
if (_.includes(errMsg, BlockchainCallErrs.USER_HAS_NO_ASSOCIATED_ADDRESSES)) {