Add default value for onConversionSuccessful
This commit is contained in:
parent
ac1fbeb962
commit
94f40a54b4
@ -32,6 +32,7 @@ export class EthWethConversionButton extends
|
|||||||
React.Component<EthWethConversionButtonProps, EthWethConversionButtonState> {
|
React.Component<EthWethConversionButtonProps, EthWethConversionButtonState> {
|
||||||
public static defaultProps: Partial<EthWethConversionButtonProps> = {
|
public static defaultProps: Partial<EthWethConversionButtonProps> = {
|
||||||
isDisabled: false,
|
isDisabled: false,
|
||||||
|
onConversionSuccessful: _.noop,
|
||||||
};
|
};
|
||||||
public constructor(props: EthWethConversionButtonProps) {
|
public constructor(props: EthWethConversionButtonProps) {
|
||||||
super(props);
|
super(props);
|
||||||
@ -100,9 +101,7 @@ export class EthWethConversionButton extends
|
|||||||
if (!this.props.isOutdatedWrappedEther) {
|
if (!this.props.isOutdatedWrappedEther) {
|
||||||
this.props.dispatcher.replaceTokenBalanceByAddress(token.address, balance);
|
this.props.dispatcher.replaceTokenBalanceByAddress(token.address, balance);
|
||||||
}
|
}
|
||||||
if (!_.isUndefined(this.props.onConversionSuccessful)) {
|
this.props.onConversionSuccessful();
|
||||||
this.props.onConversionSuccessful();
|
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const errMsg = '' + err;
|
const errMsg = '' + err;
|
||||||
if (_.includes(errMsg, BlockchainCallErrs.USER_HAS_NO_ASSOCIATED_ADDRESSES)) {
|
if (_.includes(errMsg, BlockchainCallErrs.USER_HAS_NO_ASSOCIATED_ADDRESSES)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user