Browse Source

pre-select the first coin from coin list on wallet load

all-modes
pbca26 8 years ago
parent
commit
ed96aee5d8
  1. 2
      react/src/actions/actions/addCoin.js
  2. 5
      react/src/components/dashboard/claimInterestModal/claimInterestModal.js
  3. 4
      react/src/components/dashboard/coinTile/coinTile.js
  4. 27
      react/src/components/dashboard/coinTile/coinTileItem.js

2
react/src/actions/actions/addCoin.js

@ -257,7 +257,7 @@ export function shepherdHerd(coin, mode, path, startupParams) {
console.warn(acData);
dispatch(
triggerToaster(
`Error starting ${coin} daemon. Port ${acData.rpc} is already taken!`,
`Error starting ${coin} daemon. Port ${acData.rpc} is already taken!`, // translate
translate('TOASTR.SERVICE_NOTIFICATION'),
'error',
false

5
react/src/components/dashboard/claimInterestModal/claimInterestModal.js

@ -146,10 +146,9 @@ const mapStateToProps = (state) => {
activeSection: state.ActiveCoin.activeSection,
},
Dashboard: {
displayClaimInterestModal: state.Dashboard.displayClaimInterestModal
}
displayClaimInterestModal: state.Dashboard.displayClaimInterestModal,
},
};
};
export default connect(mapStateToProps)(ClaimInterestModal);

4
react/src/components/dashboard/coinTile/coinTile.js

@ -53,8 +53,7 @@ class CoinTile extends React.Component {
<CoinTileItem
key={ i }
i={ i }
item={ item }
/>)
item={ item } />)
);
}
@ -66,7 +65,6 @@ const mapStateToProps = (state) => {
return {
allCoins: state.Main.coins,
};
};
export default connect(mapStateToProps)(CoinTile);

27
react/src/components/dashboard/coinTile/coinTileItem.js

@ -40,6 +40,27 @@ class CoinTileItem extends React.Component {
// 2) limit amount of req per update e.g. list of addresses don't change too often
// 3) limit req in basilisk as much as possible incl. activehandle
componentWillMount() {
if (!this.props.ActiveCoin.coin) {
const modes = [
'native',
'basilisk',
'full'
];
const allCoins = this.props.Main.coins;
if (allCoins) {
modes.map((mode) => {
allCoins[mode].map((coin) => {
setTimeout(() => {
this.dashboardChangeActiveCoin(coin, mode);
}, 100);
});
});
}
}
}
dispatchCoinActions(coin, mode) {
if (mode === 'native') {
Store.dispatch(iguanaActiveHandle(true));
@ -208,10 +229,10 @@ const mapStateToProps = (state) => {
},
Dashboard: state.Dashboard,
Interval: {
interval: state.Interval.interval
}
interval: state.Interval.interval,
},
Main: state.Main,
};
};
export default connect(mapStateToProps)(CoinTileItem);
Loading…
Cancel
Save