From cc904fb81862ad2f5bb497282802c647fd909ab9 Mon Sep 17 00:00:00 2001 From: Guillaume Marquilly Date: Tue, 19 Jun 2018 17:42:52 +0100 Subject: [PATCH] fix - removed update language in layout (performance issues) --- .../src/layouts/Wallet/index.js | 16 +--------------- .../src/scenes/Home/index.js | 10 +++++----- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/packages/blockchain-wallet-v4-frontend/src/layouts/Wallet/index.js b/packages/blockchain-wallet-v4-frontend/src/layouts/Wallet/index.js index 227c63d656e..9154f6b74f4 100644 --- a/packages/blockchain-wallet-v4-frontend/src/layouts/Wallet/index.js +++ b/packages/blockchain-wallet-v4-frontend/src/layouts/Wallet/index.js @@ -3,7 +3,6 @@ import { connect } from 'react-redux' import { bindActionCreators } from 'redux' import { Route, Redirect } from 'react-router-dom' -import { Remote } from 'blockchain-wallet-v4/src' import { actions, selectors } from 'data' import WalletLayout from './template' @@ -15,16 +14,6 @@ class WalletLayoutContainer extends React.PureComponent { this.props.kvStoreBuySellActions.fetchMetadataBuySell() } - // Language must also be set on settings (wallet get-info) - // if it differs from language preferences (local storage) - componentDidUpdate (prevProps) { - if (!Remote.Success.is(prevProps.payloadLanguage) && Remote.Success.is(this.props.payloadLanguage)) { - if (this.props.language !== this.props.payloadLanguage.getOrElse()) { - this.props.moduleSettingsActions.updateLanguage(this.props.language) - } - } - } - render () { const { isAuthenticated, path, computedMatch, component: Component } = this.props @@ -40,17 +29,14 @@ class WalletLayoutContainer extends React.PureComponent { const mapStateToProps = (state) => ({ language: selectors.preferences.getLanguage(state), - isAuthenticated: selectors.auth.isAuthenticated(state), - payloadLanguage: selectors.core.settings.getLanguage(state) + isAuthenticated: selectors.auth.isAuthenticated(state) }) const mapDispatchToProps = (dispatch) => ({ kvStoreShapeshiftActions: bindActionCreators(actions.core.kvStore.shapeShift, dispatch), - kvStoreEthereumActions: bindActionCreators(actions.core.kvStore.ethereum, dispatch), kvStoreWhatsNewActions: bindActionCreators(actions.core.kvStore.whatsNew, dispatch), kvStoreBuySellActions: bindActionCreators(actions.core.kvStore.buySell, dispatch), moduleSettingsActions: bindActionCreators(actions.modules.settings, dispatch), - optionsActions: bindActionCreators(actions.core.walletOptions, dispatch), settingsActions: bindActionCreators(actions.core.settings, dispatch) }) diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Home/index.js b/packages/blockchain-wallet-v4-frontend/src/scenes/Home/index.js index 885b31318ca..7f14f2e584a 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Home/index.js +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Home/index.js @@ -7,7 +7,7 @@ import { selectors } from 'data' import ActivityList from './ActivityList' import DidYouKnow from './DidYouKnow' import PriceChart from './PriceChart' -import BalancesChartContainer from './BalancesChart' +import BalancesChart from './BalancesChart' import SfoxSignupBanner from './SfoxSignupBanner' import ErrorBoundary from 'providers/ErrorBoundaryProvider' @@ -61,12 +61,12 @@ class Home extends React.PureComponent { { buySellKv.cata({ Success: () => , Failure: () =>
, Loading: () =>
, NotAsked: () =>
}) } - - + + - - + +