Browse Source

login activeHandle fix

all-modes
pbca26 8 years ago
parent
commit
dc8bfabf5a
  1. 35
      react/src/components/dashboard/sendCoin.js
  2. 2
      react/src/components/dashboard/walletsBasiliskRefresh.js
  3. 8
      react/src/components/dashboard/walletsCacheData.js
  4. 2
      react/src/components/dashboard/walletsData.js

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

@ -272,12 +272,32 @@ class SendCoin extends React.Component {
}
changeSendCoinStep(step) {
Store.dispatch(clearLastSendToResponseState());
if (step === 0) {
Store.dispatch(clearLastSendToResponseState());
this.setState({
currentStep: 0,
sendFrom: this.props.Dashboard && this.props.Dashboard.activeHandle ? this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] : null,
sendFromAmount: 0,
sendTo: '',
sendToOA: null,
amount: 0,
fee: 0.0001,
sendSig: false,
sendApiType: false,
addressSelectorOpen: false,
currentStackLength: 0,
totalStackLength: 0,
utxoMethodInProgress: false,
});
}
this.setState(Object.assign({}, this.state, {
currentStep: step,
utxoMethodInProgress: !this.state.sendApiType && this.props.ActiveCoin.mode === 'basilisk' ? true : false,
}));
if (step === 1 || step === 2) {
this.setState(Object.assign({}, this.state, {
currentStep: step,
utxoMethodInProgress: !this.state.sendApiType && this.props.ActiveCoin.mode === 'basilisk' ? true : false,
}));
}
if (step === 2) {
if (!this.state.sendApiType && this.props.ActiveCoin.mode === 'basilisk') {
@ -297,6 +317,7 @@ class SendCoin extends React.Component {
toggleSendAPIType() {
this.setState(Object.assign({}, this.state, {
sendApiType: !this.state.sendApiType,
fee: !this.state.sendApiType ? 0 : 0.0001,
sendFrom: this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin],
}));
}
@ -492,7 +513,7 @@ class SendCoin extends React.Component {
<span className="label label-success">{this.props.ActiveCoin.lastSendToResponse[key] === true ? 'true' : 'success'}</span>
);
} else {
if (key === 'result' && this.props.ActiveCoin.lastSendToResponse.result && !Object.keys(this.props.ActiveCoin.lastSendToResponse.result).length) {
if (key === 'result' && this.props.ActiveCoin.lastSendToResponse.result && typeof this.props.ActiveCoin.lastSendToResponse.result !== 'object') {
return (
<span>{this.props.ActiveCoin.lastSendToResponse.result}</span>
);
@ -711,7 +732,7 @@ class SendCoin extends React.Component {
</div>
<div className="col-lg-6 form-group form-material">
<label className="control-label" data-edexcoin="COIN" htmlFor="edexcoin_fee">{translate('INDEX.FEE')}</label>
<input type="text" className="form-control" id="edexcoin_fee" name="fee" defaultValue={this.state.fee} placeholder="0.000" autoComplete="off" onChange={this.updateInput} />
<input type="text" className="form-control" id="edexcoin_fee" name="fee" defaultValue={this.state.fee} value={this.state.fee} placeholder="0.000" autoComplete="off" onChange={this.updateInput} />
</div>
<div className="col-lg-12">
<span data-edexcoin="KMD">

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

@ -12,7 +12,7 @@ class WalletsBasiliskRefresh extends React.Component {
<div className="panel-heading">
<h3 className="panel-title">{translate('INDEX.FETCHING_BASILISK_DATA')}</h3>
<div className="panel-actions">
<a className="panel-action icon md-refresh-alt" data-toggle="panel-refresh" data-load-type="blue-only" aria-hidden="true"></a>
<a className="panel-action icon md-refresh-alt" aria-hidden="true"></a>
</div>
</div>
<div className="table-responsive">

8
react/src/components/dashboard/walletsCacheData.js

@ -125,7 +125,9 @@ class WalletsCacheData extends React.Component {
}
renderCoinData() {
if (this.props.ActiveCoin.notaries && this.props.ActiveCoin.notaries.notaries && this.props.ActiveCoin.notaries.notaries.length) {
if (this.props.ActiveCoin.notaries &&
this.props.ActiveCoin.notaries.notaries &&
this.props.ActiveCoin.notaries.notaries.length) {
return this.props.ActiveCoin.notaries.notaries.map((node, index) =>
<TreeNode title={`Node ${index}`} key={`node-${index}`}>
<TreeNode key={`node-${index}-btc`} title={`BTC: ${node.BTCaddress}`} />
@ -139,7 +141,9 @@ class WalletsCacheData extends React.Component {
}
render() {
if (this.props && this.props.ActiveCoin.mode === 'basilisk' && this.props.Dashboard.displayViewCacheModal) {
if (this.props &&
this.props.ActiveCoin.mode === 'basilisk' &&
this.props.Dashboard.displayViewCacheModal) {
return (
<div>

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

@ -429,7 +429,7 @@ class WalletsData extends React.Component {
let _amount = address.amount;
if (this.props.ActiveCoin.mode === 'basilisk') {
_amount = this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data.balance ? this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data.balance : 'N/A';
_amount = this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address] && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data.balance ? this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data.balance : 'N/A';
}
items.push(

Loading…
Cancel
Save