Browse Source

skip dashboard update if wallets tab is not selected

all-modes
pbca26 8 years ago
parent
commit
9765bffe17
  1. 131
      react/src/components/dashboard/coinTile/coinTileItem.js

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

@ -79,86 +79,89 @@ class CoinTileItem extends React.Component {
} }
dispatchCoinActions(coin, mode) { dispatchCoinActions(coin, mode) {
if (mode === 'native') { if (this.props.Dashboard &&
Store.dispatch(iguanaActiveHandle(true)); this.props.Dashboard.activeSection === 'wallets') {
const _propsDashboard = this.props.ActiveCoin; if (mode === 'native') {
const syncPercentage = _propsDashboard && _propsDashboard.progress && (parseFloat(parseInt(_propsDashboard.progress.blocks, 10) * 100 / parseInt(_propsDashboard.progress.longestchain, 10)).toFixed(2)).replace('NaN', 0); Store.dispatch(iguanaActiveHandle(true));
const _propsDashboard = this.props.ActiveCoin;
const syncPercentage = _propsDashboard && _propsDashboard.progress && (parseFloat(parseInt(_propsDashboard.progress.blocks, 10) * 100 / parseInt(_propsDashboard.progress.longestchain, 10)).toFixed(2)).replace('NaN', 0);
if ((syncPercentage < 100 &&
!this.props.Dashboard.displayCoindDownModal) ||
this.props.ActiveCoin.rescanInProgress) {
if (coin === 'KMD') {
Store.dispatch(getDebugLog('komodo', 50));
} else {
Store.dispatch(getDebugLog('komodo', 50, coin));
}
}
if (!this.props.Dashboard.displayCoindDownModal &&
_propsDashboard.progress &&
_propsDashboard.progress.blocks &&
_propsDashboard.progress.longestchain &&
syncPercentage &&
(Config.iguanaLessMode || syncPercentage >= NATIVE_MIN_SYNC_PERCENTAGE_THRESHOLD)) {
Store.dispatch(
getSyncInfoNative(
coin,
true,
this.props.Dashboard.skipFullDashboardUpdate,
this.props.ActiveCoin.rescanInProgress
)
);
if ((syncPercentage < 100 && if (!this.props.Dashboard.skipFullDashboardUpdate) {
!this.props.Dashboard.displayCoindDownModal) || Store.dispatch(getDashboardUpdate(coin, _propsDashboard));
this.props.ActiveCoin.rescanInProgress) { }
if (coin === 'KMD') {
Store.dispatch(getDebugLog('komodo', 50));
} else { } else {
Store.dispatch(getDebugLog('komodo', 50, coin)); Store.dispatch(
getSyncInfoNative(
coin,
null,
this.props.Dashboard.skipFullDashboardUpdate,
this.props.ActiveCoin.rescanInProgress
)
);
} }
} }
if (mode === 'full') {
Store.dispatch(iguanaActiveHandle(true));
Store.dispatch(getSyncInfo(coin));
Store.dispatch(iguanaEdexBalance(coin, mode));
Store.dispatch(getAddressesByAccount(coin, mode));
Store.dispatch(getFullTransactionsList(coin));
}
if (mode === 'basilisk') {
const useAddress = this.props.ActiveCoin.mainBasiliskAddress ? this.props.ActiveCoin.mainBasiliskAddress : this.props.Dashboard.activeHandle[coin];
Store.dispatch(iguanaActiveHandle(true));
if (!this.props.Dashboard.displayCoindDownModal &&
_propsDashboard.progress &&
_propsDashboard.progress.blocks &&
_propsDashboard.progress.longestchain &&
syncPercentage &&
(Config.iguanaLessMode || syncPercentage >= NATIVE_MIN_SYNC_PERCENTAGE_THRESHOLD)) {
Store.dispatch( Store.dispatch(
getSyncInfoNative( getKMDAddressesNative(
coin, coin,
true, mode,
this.props.Dashboard.skipFullDashboardUpdate, useAddress
this.props.ActiveCoin.rescanInProgress
) )
); );
if (!this.props.Dashboard.skipFullDashboardUpdate) {
Store.dispatch(getDashboardUpdate(coin, _propsDashboard));
}
} else {
Store.dispatch( Store.dispatch(
getSyncInfoNative( getShepherdCache(
coin, JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey,
null, coin
this.props.Dashboard.skipFullDashboardUpdate,
this.props.ActiveCoin.rescanInProgress
) )
); );
}
}
if (mode === 'full') {
Store.dispatch(iguanaActiveHandle(true));
Store.dispatch(getSyncInfo(coin));
Store.dispatch(iguanaEdexBalance(coin, mode));
Store.dispatch(getAddressesByAccount(coin, mode));
Store.dispatch(getFullTransactionsList(coin));
}
if (mode === 'basilisk') {
const useAddress = this.props.ActiveCoin.mainBasiliskAddress ? this.props.ActiveCoin.mainBasiliskAddress : this.props.Dashboard.activeHandle[coin];
Store.dispatch(iguanaActiveHandle(true));
Store.dispatch( if (this.props &&
getKMDAddressesNative( this.props.Dashboard &&
coin, this.props.Dashboard.activeHandle &&
mode, this.props.Dashboard.activeHandle[coin]) {
useAddress if (!this.props.ActiveCoin.addresses) {
) Store.dispatch(getAddressesByAccount(coin, mode));
); }
Store.dispatch(
getShepherdCache(
JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey,
coin
)
);
if (this.props && Store.dispatch(getBasiliskTransactionsList(coin, useAddress));
this.props.Dashboard &&
this.props.Dashboard.activeHandle &&
this.props.Dashboard.activeHandle[coin]) {
if (!this.props.ActiveCoin.addresses) {
Store.dispatch(getAddressesByAccount(coin, mode));
} }
Store.dispatch(getBasiliskTransactionsList(coin, useAddress));
} }
} }
} }

Loading…
Cancel
Save