From d34a436cafe628d6cb828a91759dab0cc49f9b4d Mon Sep 17 00:00:00 2001 From: pbca26 Date: Thu, 3 Aug 2017 12:46:11 +0300 Subject: [PATCH] basilisk tx history address selector check mark --- .../dashboard/walletsData/walletsData.js | 24 ++++++++++++------- .../walletsData/walletsData.render.js | 2 +- .../walletsTxInfo/walletsTxInfo.render.js | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/react/src/components/dashboard/walletsData/walletsData.js b/react/src/components/dashboard/walletsData/walletsData.js index 119a589..74bdbb4 100644 --- a/react/src/components/dashboard/walletsData/walletsData.js +++ b/react/src/components/dashboard/walletsData/walletsData.js @@ -124,22 +124,24 @@ class WalletsData extends React.Component { } updateSocketsData(data) { + let stateObj = {}; + if (this.props.ActiveCoin.mode === 'basilisk') { if (data && data.message && data.message.shepherd.iguanaAPI && data.message.shepherd.iguanaAPI.totalStackLength) { - this.setState(Object.assign({}, this.state, { + stateObj = Object.assign(stateObj, { totalStackLength: data.message.shepherd.iguanaAPI.totalStackLength, - })); + }); } if (data && data.message && data.message.shepherd.iguanaAPI && data.message.shepherd.iguanaAPI.currentStackLength) { - this.setState(Object.assign({}, this.state, { + stateObj = Object.assign(stateObj, { currentStackLength: data.message.shepherd.iguanaAPI.currentStackLength, - })); + }); } if (data && data.message && @@ -148,6 +150,8 @@ class WalletsData extends React.Component { data.message.shepherd.status === 'done') { Store.dispatch(basiliskRefresh(false)); } + + this.setState(Object.assign({}, this.state, stateObj)); } } @@ -254,8 +258,8 @@ class WalletsData extends React.Component { if (this.props && this.props.ActiveCoin && this.props.ActiveCoin.coin) { - if (!this.state.currentAddress && - this.props.ActiveCoin.activeAddress) { + if ((!this.state.currentAddress && this.props.ActiveCoin.activeAddress) || + (this.state.currentAddress !== this.props.ActiveCoin.activeAddress)) { stateObj = Object.assign(stateObj, { currentAddress: this.props.ActiveCoin.activeAddress, }); @@ -307,9 +311,9 @@ class WalletsData extends React.Component { itemsList: historyToSplit, }); } - } - this.setState(Object.assign({}, this.state, stateObj)); + this.setState(Object.assign({}, this.state, stateObj)); + } } updateCurrentPage(page) { @@ -518,7 +522,9 @@ class WalletsData extends React.Component { } items.push( -
  • +
  • this.updateAddressSelection(address, type, _amount) }>    [ { _amount } { _coin } ]  { address } diff --git a/react/src/components/dashboard/walletsData/walletsData.render.js b/react/src/components/dashboard/walletsData/walletsData.render.js index 13d77f3..c587b5e 100644 --- a/react/src/components/dashboard/walletsData/walletsData.render.js +++ b/react/src/components/dashboard/walletsData/walletsData.render.js @@ -131,7 +131,7 @@ export const AddressListRender = function() {
    diff --git a/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js b/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js index 67fb416..4508d8c 100644 --- a/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js +++ b/react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js @@ -51,7 +51,7 @@ const WalletsTxInfoRender = function(txInfo) { { translate('TX_INFO.ADDRESS') } - { txInfo.address } + { this.props.ActiveCoin.mode === 'basilisk' ? this.props.ActiveCoin.activeAddress : txInfo.address }