diff options
Diffstat (limited to 'ui/app/components/user-preferenced-currency-display/user-preferenced-currency-display.container.js')
-rw-r--r-- | ui/app/components/user-preferenced-currency-display/user-preferenced-currency-display.container.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/ui/app/components/user-preferenced-currency-display/user-preferenced-currency-display.container.js b/ui/app/components/user-preferenced-currency-display/user-preferenced-currency-display.container.js index 23240c649..7999301ad 100644 --- a/ui/app/components/user-preferenced-currency-display/user-preferenced-currency-display.container.js +++ b/ui/app/components/user-preferenced-currency-display/user-preferenced-currency-display.container.js @@ -4,15 +4,16 @@ import { preferencesSelector } from '../../selectors' import { ETH, PRIMARY, SECONDARY } from '../../constants/common' const mapStateToProps = (state, ownProps) => { - const { useETHAsPrimaryCurrency } = preferencesSelector(state) + const { useNativeCurrencyAsPrimaryCurrency } = preferencesSelector(state) return { - useETHAsPrimaryCurrency, + useNativeCurrencyAsPrimaryCurrency, + nativeCurrency: state.metamask.nativeCurrency, } } const mergeProps = (stateProps, dispatchProps, ownProps) => { - const { useETHAsPrimaryCurrency, ...restStateProps } = stateProps + const { useNativeCurrencyAsPrimaryCurrency, nativeCurrency, ...restStateProps } = stateProps const { type, numberOfDecimals: propsNumberOfDecimals, @@ -26,14 +27,14 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => { let currency, numberOfDecimals, prefix - if (type === PRIMARY && useETHAsPrimaryCurrency || - type === SECONDARY && !useETHAsPrimaryCurrency) { + if (type === PRIMARY && useNativeCurrencyAsPrimaryCurrency || + type === SECONDARY && !useNativeCurrencyAsPrimaryCurrency) { // Display ETH - currency = ETH + currency = nativeCurrency || ETH numberOfDecimals = propsNumberOfDecimals || ethNumberOfDecimals || 6 prefix = propsPrefix || ethPrefix - } else if (type === SECONDARY && useETHAsPrimaryCurrency || - type === PRIMARY && !useETHAsPrimaryCurrency) { + } else if (type === SECONDARY && useNativeCurrencyAsPrimaryCurrency || + type === PRIMARY && !useNativeCurrencyAsPrimaryCurrency) { // Display Fiat numberOfDecimals = propsNumberOfDecimals || fiatNumberOfDecimals || 2 prefix = propsPrefix || fiatPrefix @@ -43,6 +44,7 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => { ...restStateProps, ...dispatchProps, ...restOwnProps, + nativeCurrency, currency, numberOfDecimals, prefix, |