diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js index 646890a..effbe50 100644 --- a/react/src/actions/actionCreators.js +++ b/react/src/actions/actionCreators.js @@ -925,7 +925,7 @@ export function addPeerNode(coin, ip) { } } -export function getAddressesByAccountState(json, coin, mode) { +export function setBasiliskMainAddress(json, coin, mode) { if (mode === 'full') { let publicAddressArray = []; @@ -942,6 +942,31 @@ export function getAddressesByAccountState(json, coin, mode) { if (mode === 'basilisk') { getDexBalance(coin, mode, json.result); } + const _mainAddr = [] + + return { + type: ACTIVE_COIN_GET_ADDRESSES, + addresses: { 'public': [] }, + } +} + +export function getAddressesByAccountState(json, coin, mode) { + if (mode === 'full' || mode === 'basilisk') { + let publicAddressArray = []; + + for (let i = 0; i < json.result.length; i++) { + publicAddressArray.push({ + 'address': json.result[i], + 'amount': 'N/A' + }); + } + + json.result = publicAddressArray; + } + + /*if (mode === 'basilisk') { + getDexBalance(coin, mode, json.result); + }*/ return { type: ACTIVE_COIN_GET_ADDRESSES, @@ -971,7 +996,7 @@ export function getAddressesByAccount(coin, mode) { dispatch(triggerToaster(true, 'getAddressesByAccount', 'Error', 'error')); }) .then(response => response.json()) - .then(json => dispatch(getAddressesByAccountState(json, coin, mode, dispatch))) + .then(json => dispatch(getAddressesByAccountState(json, coin, mode))) } } @@ -1403,13 +1428,13 @@ export function fetchUtxoCache(_payload) { function getShepherdCacheState(json, pubkey, coin) { if (json.result && json.error && json.result.indexOf('no file with handle') > -1) { - console.log('request new cache', true); + console.log('request new cache', { 'pubkey': pubkey, 'coin': coin }); return dispatch => { dispatch(fetchNewCacheData({ 'pubkey': pubkey, 'allcoins': false, 'coin': coin, - 'calls': 'listtransactions:getbalance:listunspent', + 'calls': 'listtransactions:getbalance', })); } } else { @@ -1605,7 +1630,7 @@ export function getSyncInfoNative(coin, skipDebug) { } } -export function getDexBalance(coin, addr) { +export function getDexBalance(coin, mode, addr) { Promise.all(addr.map((_addr, index) => { const payload = { 'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), diff --git a/react/src/components/addcoin/addcoin.js b/react/src/components/addcoin/addcoin.js index 4f55e92..725b509 100644 --- a/react/src/components/addcoin/addcoin.js +++ b/react/src/components/addcoin/addcoin.js @@ -36,6 +36,7 @@ class AddCoin extends React.Component { }, display: false, actionsMenu: false, + modalClassName: 'hide', }; this.activateCoin = this.activateCoin.bind(this); this.dismiss = this.dismiss.bind(this); @@ -56,7 +57,7 @@ class AddCoin extends React.Component { loadCoinSelection() { shepherdGetCoinList() .then(function(json) { - if (json.msg !== 'error') { + if (json.msg !== 'error') { this.setState(Object.assign({}, this.state, { coins: json.result, actionsMenu: false, @@ -90,10 +91,18 @@ class AddCoin extends React.Component { } componentWillReceiveProps(props) { - if (props) { + if (props && props.display !== this.state.display) { this.setState(Object.assign({}, this.state, { display: props.display, + modalClassName: props.display ? 'show fade' : 'show fade', })); + + setTimeout(function() { + this.setState(Object.assign({}, this.state, { + display: props.display, + modalClassName: props.display ? 'show in' : 'hide', + })); + }.bind(this), 100); } } @@ -307,7 +316,7 @@ class AddCoin extends React.Component { return (