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

3
src/components/AccountPage/index.js

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

Loading…
Cancel
Save