Browse Source

post active coin change remove coin cleanup

v0.25
pbca26 7 years ago
parent
commit
45a95385e0
  1. 8
      react/src/components/dashboard/coinTile/coinTileItem.js
  2. 12
      react/src/reducers/activeCoin.js

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

@ -158,6 +158,9 @@ class CoinTileItem extends React.Component {
Store.dispatch(activeHandle());
setTimeout(() => {
this.autoSetActiveCoin();
setTimeout(() => {
Store.dispatch(dashboardRemoveCoin(coin));
}, 500);
}, 500);
});
}
@ -187,6 +190,9 @@ class CoinTileItem extends React.Component {
Store.dispatch(activeHandle());
setTimeout(() => {
this.autoSetActiveCoin();
setTimeout(() => {
Store.dispatch(dashboardRemoveCoin(coin));
}, 500);
}, 500);
}
});
@ -237,7 +243,7 @@ class CoinTileItem extends React.Component {
)
);
}
} else if (mode === 'spv') {
} else if (mode === 'spv' && this.props.Dashboard.electrumCoins[coin].pub) {
Store.dispatch(shepherdElectrumBalance(coin, this.props.Dashboard.electrumCoins[coin].pub));
Store.dispatch(shepherdElectrumTransactions(coin, this.props.Dashboard.electrumCoins[coin].pub));
}

12
react/src/reducers/activeCoin.js

@ -42,11 +42,12 @@ export function ActiveCoin(state = {
}, action) {
switch (action.type) {
case DASHBOARD_REMOVE_COIN:
let _coins = state.coins;
delete _coins[action.coin];
return {
...state,
coins: _coins,
if (state.coins && state.coins[action.coin]) {
delete state.coins[action.coin];
return {
...state,
};
}
case DASHBOARD_ACTIVE_COIN_CHANGE:
if (state.coins[action.coin]) {
@ -71,6 +72,7 @@ export function ActiveCoin(state = {
};
let _coins = state.coins;
_coins[state.coin] = _coinDataToStore;
delete _coins.undefined;
return {
...state,

Loading…
Cancel
Save