Browse Source

send coin amount validation fix

v0.25
pbca26 7 years ago
parent
commit
343c262ec5
  1. 6
      react/src/components/dashboard/coinTile/coinTileItem.render.js
  2. 9
      react/src/components/dashboard/sendCoin/sendCoin.js

6
react/src/components/dashboard/coinTile/coinTileItem.render.js

@ -24,7 +24,11 @@ const CoinTileItemRender = function() {
</div>
</div>
</div>
{ this.props.Dashboard && this.props.Dashboard.electrumCoins && this.props.Dashboard.electrumCoins[item.coin].serverList && this.props.Dashboard.electrumCoins[item.coin].serverList === 'none' &&
{ this.props.Dashboard &&
this.props.Dashboard.electrumCoins &&
this.props.Dashboard.electrumCoins[item.coin] &&
this.props.Dashboard.electrumCoins[item.coin].serverList &&
this.props.Dashboard.electrumCoins[item.coin].serverList === 'none' &&
<i
title={ translate('SETTINGS.SPV_SINGLE_SERVER_NOTICE') }
className="icon fa-info-circle icon-spv-connection-warning"></i>

9
react/src/components/dashboard/sendCoin/sendCoin.js

@ -431,10 +431,9 @@ class SendCoin extends React.Component {
if (this.props.ActiveCoin.mode === 'spv') {
const _amount = this.state.amount;
const _amountSats = this.state.amount * 100000000;
const _balanceSats = this.props.ActiveCoin.balance.sats;
const _fee = this.props.Dashboard.electrumCoins[this.props.ActiveCoin.coin].txfee;
const _balanceSats = this.props.ActiveCoin.balance.balanceSats;
if (_amountSats > (Number(_balanceSats) + Number(_fee))) {
if (_amountSats > _balanceSats) {
Store.dispatch(
triggerToaster(
translate('SEND.INSUFFICIENT_FUNDS'),
@ -446,9 +445,9 @@ class SendCoin extends React.Component {
}
console.warn('send val ' + this.state.amount);
console.warn('send val sats ' + (this.state.amount * 100000000));
console.warn('send val sats ' + _amountSats);
console.warn(this.props.ActiveCoin.balance.sats);
console.warn(`balance ${this.props.ActiveCoin.balance.balanceSats}`);
console.warn(this.props.Dashboard.electrumCoins[this.props.ActiveCoin.coin].txfee);
}

Loading…
Cancel
Save