diff --git a/react/src/components/dashboard/receiveCoin.js b/react/src/components/dashboard/receiveCoin.js index 67ebdd3..e3f362f 100644 --- a/react/src/components/dashboard/receiveCoin.js +++ b/react/src/components/dashboard/receiveCoin.js @@ -28,13 +28,6 @@ class ReceiveCoin extends React.Component { Store.dispatch(copyCoinAddress(address)); } - /*importAddressBasilisk(address) { - Store.dispatch(importAddressBasilisk(this.props.coin, address)); - } - this.importAddressBasilisk(address)}> - - */ - renderAddressActions(address) { if (this.props.mode === 'basilisk') { return ( @@ -64,15 +57,32 @@ class ReceiveCoin extends React.Component { } renderAddressList() { - if (this.props.addresses && this.props.addresses['public'] && this.props.addresses['public'].length) { - return this.props.addresses['public'].map((address) => - - {this.renderAddressActions(address.address)} - {address.address} - {address.amount} - {address.interest ? address.interest : 'N/A'} - - ); + if (this.props.addresses && + this.props.addresses.public && + this.props.addresses.public.length) { + let items = []; + + for (let i = 0; i < this.props.addresses.public.length; i++) { + let address = this.props.addresses.public[i]; + + if (this.props.mode === 'basilisk' && address.amount === 'N/A') { + address.amount = this.props.cache[this.props.coin][address.address].getbalance.data && this.props.cache[this.props.coin][address.address].getbalance.data.balance ? this.props.cache[this.props.coin][address.address].getbalance.data.balance : 'N/A'; + } + if (this.props.mode === 'basilisk' && (address.interest === 'N/A' || !address.interest)) { + address.interest = this.props.cache[this.props.coin][address.address].getbalance.data && this.props.cache[this.props.coin][address.address].getbalance.data.interest ? this.props.cache[this.props.coin][address.address].getbalance.data.interest : 'N/A'; + } + + items.push( + + {this.renderAddressActions(address.address)} + {address.address} + {address.amount} + {address.interest ? address.interest : 'N/A'} + + ); + } + + return items; } else { return null; } diff --git a/react/src/components/dashboard/walletsBalance.js b/react/src/components/dashboard/walletsBalance.js index bdb28df..ab09d8a 100644 --- a/react/src/components/dashboard/walletsBalance.js +++ b/react/src/components/dashboard/walletsBalance.js @@ -28,6 +28,7 @@ class WalletsBalance extends React.Component { if (type === 'main' && this.props.ActiveCoin.mode === 'basilisk' && this.props.ActiveCoin.activeAddress && + this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress]&& this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data.balance) { @@ -37,6 +38,7 @@ class WalletsBalance extends React.Component { if (type === 'interest' && this.props.ActiveCoin.mode === 'basilisk' && this.props.ActiveCoin.activeAddress && + this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress] && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data.interest) { @@ -46,6 +48,7 @@ class WalletsBalance extends React.Component { if (type === 'total' && this.props.ActiveCoin.mode === 'basilisk' && this.props.ActiveCoin.activeAddress && + this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress] && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data && (this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data.balance || diff --git a/react/src/components/dashboard/walletsData.js b/react/src/components/dashboard/walletsData.js index f1fd130..ba647f3 100644 --- a/react/src/components/dashboard/walletsData.js +++ b/react/src/components/dashboard/walletsData.js @@ -439,12 +439,6 @@ class WalletsData extends React.Component { } return items; - - /*return this.props.ActiveCoin.addresses[type].map((address) => -
  • - this.updateAddressSelection(address.address, type, address.amount)}> [ {address.amount} {this.props.ActiveCoin.coin} ]  {address.address} -
  • - );*/ } else { return null; }