Browse Source
Fix CounterValue component (fixes OperationsList)
master
meriadec
7 years ago
No known key found for this signature in database
GPG Key ID: 1D2FC2305E2CB399
1 changed files with
3 additions and
4 deletions
-
src/components/CounterValue/index.js
|
|
@ -3,6 +3,7 @@ |
|
|
|
import React, { PureComponent } from 'react' |
|
|
|
import { connect } from 'react-redux' |
|
|
|
import moment from 'moment' |
|
|
|
import { getFiatUnit } from '@ledgerhq/currencies' |
|
|
|
import type { Unit, Currency } from '@ledgerhq/currencies' |
|
|
|
|
|
|
|
import { getCounterValueCode } from 'reducers/settings' |
|
|
@ -43,10 +44,8 @@ export class CounterValue extends PureComponent<Props> { |
|
|
|
getCounterValue, |
|
|
|
...props |
|
|
|
} = this.props |
|
|
|
|
|
|
|
const date = moment(time).format('YYYY-MM-DD') |
|
|
|
const v = getCounterValue(currency, counterValueCode)(value, date) |
|
|
|
|
|
|
|
const date = new Date(moment(time).format('YYYY-MM-DD')) |
|
|
|
const v = getCounterValue(currency, getFiatUnit(counterValueCode))(value, date) |
|
|
|
return formatValue ? ( |
|
|
|
<FormattedVal val={v} fiat={counterValueCode} showCode alwaysShowSign {...props} /> |
|
|
|
) : ( |
|
|
|