Browse Source

native send validation subtract fee fix, disable subtract for z addr

v0.25
pbca26 7 years ago
parent
commit
4ffd70701b
  1. 2
      react/src/components/dashboard/sendCoin/sendCoin.js
  2. 30
      react/src/components/dashboard/sendCoin/sendCoin.render.js
  3. 12
      react/src/components/dashboard/settings/settings.debugLogPanel.js
  4. 2
      react/src/components/dashboard/settings/settings.render.js

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

@ -529,7 +529,7 @@ class SendCoin extends React.Component {
this.state.sendTo.length === 34 &&
this.props.ActiveCoin.balance &&
this.props.ActiveCoin.balance.transparent &&
Number(Number(this.state.amount) + 0.0001) > Number(this.props.ActiveCoin.balance.transparent)) ||
Number(Number(this.state.amount) + (this.state.subtractFee ? 0 : 0.0001)) > Number(this.props.ActiveCoin.balance.transparent)) ||
(this.state.addressType === 'public' &&
this.state.sendTo &&
this.state.sendTo.length > 34 &&

30
react/src/components/dashboard/sendCoin/sendCoin.render.js

@ -78,21 +78,23 @@ export const _SendFormRender = function() {
autoComplete="off" />
</div>
<div className={ 'col-lg-6 form-group form-material' + (this.isTransparentTx() && this.props.ActiveCoin.mode === 'native' ? '' : ' hide') }>
<span className="pointer">
<label className="switch">
<input
type="checkbox"
checked={ this.state.subtractFee } />
{ this.state.sendTo.length <= 34 &&
<span className="pointer">
<label className="switch">
<input
type="checkbox"
checked={ this.state.subtractFee } />
<div
className="slider"
onClick={ () => this.toggleSubtractFee() }></div>
</label>
<div
className="slider"
onClick={ () => this.toggleSubtractFee() }></div>
</label>
<div
className="toggle-label"
onClick={ () => this.toggleSubtractFee() }>
{ translate('DASHBOARD.SUBTRACT_FEE') }
</div>
</span>
className="toggle-label"
onClick={ () => this.toggleSubtractFee() }>
{ translate('DASHBOARD.SUBTRACT_FEE') }
</div>
</span>
}
</div>
<div className="col-lg-6 form-group form-material hide">
<label

12
react/src/components/dashboard/settings/settings.debugLogPanel.js

@ -26,6 +26,7 @@ class DebugLogPanel extends React.Component {
this.getAppRuntimeLog = this.getAppRuntimeLog.bind(this);
this.toggleAppRuntimeLog = this.toggleAppRuntimeLog.bind(this);
this.renderAppRuntimeLog = this.renderAppRuntimeLog.bind(this);
this.checkInputVals = this.checkInputVals.bind(this);
}
readDebugLog() {
@ -136,6 +137,15 @@ class DebugLogPanel extends React.Component {
return _items;
}
checkInputVals() {
if (!Number(this.state.debugLinesCount) ||
Number(this.state.debugLinesCount) < 1 ||
!this.state.debugLinesCount ||
this.state.debugTarget === 'none') {
return true;
}
}
render() {
return (
<div className="row">
@ -195,7 +205,7 @@ class DebugLogPanel extends React.Component {
<button
type="button"
className="btn btn-primary waves-effect waves-light"
disabled={ (Number(this.state.debugLinesCount) === NaN || Number(this.state.debugLinesCount) < 1 || !this.state.debugLinesCount) || this.state.debugTarget === 'none' }
disabled={ this.checkInputVals() }
onClick={ this.readDebugLog }>{ translate('INDEX.LOAD_DEBUG_LOG') }</button>
</div>
<div className="row">

2
react/src/components/dashboard/settings/settings.render.js

@ -81,7 +81,7 @@ export const SettingsRender = function() {
this.props.Main.coins.native &&
Object.keys(this.props.Main.coins.native).length > 0 &&
<PanelSection
title={ 'Debug / Komodod stdout' }
title={ 'Komodod stdout' }
icon="icon fa-bug">
<DaemonStdoutPanel />
</PanelSection>

Loading…
Cancel
Save