Browse Source

Merge pull request #799 from meriadec/fix-account-id-in-key

Prevent ticker animation when changing account page at lower level
master
Gaëtan Renaudeau 7 years ago
committed by GitHub
parent
commit
96da9a58ee
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/components/AccountPage/AccountBalanceSummaryHeader.js
  2. 3
      src/components/AccountPage/index.js

4
src/components/AccountPage/AccountBalanceSummaryHeader.js

@ -28,7 +28,7 @@ type OwnProps = {
totalBalance: number, totalBalance: number,
sinceBalance: number, sinceBalance: number,
refBalance: number, refBalance: number,
accountId: string, // eslint-disable-line accountId: string,
} }
type Props = OwnProps & { type Props = OwnProps & {
@ -57,6 +57,7 @@ class AccountBalanceSummaryHeader extends PureComponent<Props> {
render() { render() {
const { const {
account, account,
accountId,
t, t,
counterValue, counterValue,
selectedTimeRange, selectedTimeRange,
@ -76,6 +77,7 @@ class AccountBalanceSummaryHeader extends PureComponent<Props> {
unit={account.unit} unit={account.unit}
> >
<FormattedVal <FormattedVal
key={accountId}
animateTicker animateTicker
disableRounding disableRounding
alwaysShowSign={false} alwaysShowSign={false}

3
src/components/AccountPage/index.js

@ -68,8 +68,7 @@ class AccountPage extends PureComponent<Props> {
} }
return ( return (
// `key` forces re-render account page when going an another account (skip animations) <Box>
<Box key={account.id}>
<TrackPage <TrackPage
category="Account" category="Account"
currency={account.currency.id} currency={account.currency.id}

Loading…
Cancel
Save