Browse Source

prevent claiming interest if coin is not kmd

v0.25
pbca26 7 years ago
parent
commit
a2e5363575
  1. 58
      react/src/components/dashboard/claimInterestModal/claimInterestModal.js

58
react/src/components/dashboard/claimInterestModal/claimInterestModal.js

@ -72,31 +72,33 @@ class ClaimInterestModal extends React.Component {
} }
claimInterest(address, amount) { claimInterest(address, amount) {
sendToAddressPromise( if (this.props.ActiveCoin.coin === 'KMD') {
this.props.ActiveCoin.coin, sendToAddressPromise(
this.state.transactionsList[0].address, this.props.ActiveCoin.coin,
this.props.ActiveCoin.balance.transparent this.state.transactionsList[0].address,
).then((json) => { this.props.ActiveCoin.balance.transparent
if (json.error && ).then((json) => {
json.error.code) { if (json.error &&
Store.dispatch( json.error.code) {
triggerToaster( Store.dispatch(
json.error.message, triggerToaster(
'Error', json.error.message,
'error' 'Error',
) 'error'
); )
} else if (json.result && json.result.length && json.result.length === 64) { );
Store.dispatch( } else if (json.result && json.result.length && json.result.length === 64) {
triggerToaster( Store.dispatch(
`${translate('TOASTR.CLAIM_INTEREST_BALANCE_SENT_P1')} ${this.state.transactionsList[0].address}. ${translate('TOASTR.CLAIM_INTEREST_BALANCE_SENT_P2')}`, triggerToaster(
translate('TOASTR.WALLET_NOTIFICATION'), `${translate('TOASTR.CLAIM_INTEREST_BALANCE_SENT_P1')} ${this.state.transactionsList[0].address}. ${translate('TOASTR.CLAIM_INTEREST_BALANCE_SENT_P2')}`,
'success', translate('TOASTR.WALLET_NOTIFICATION'),
false 'success',
) false
); )
} );
}); }
});
}
} }
checkTransactionsListLength() { checkTransactionsListLength() {
@ -140,7 +142,11 @@ class ClaimInterestModal extends React.Component {
} }
render() { render() {
return ClaimInterestModalRender.call(this); if (coin === 'KMD') {
return ClaimInterestModalRender.call(this);
} else {
return null;
}
} }
} }

Loading…
Cancel
Save