diff options
author | kumavis <aaron@kumavis.me> | 2018-10-30 08:25:05 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2018-10-30 08:25:05 +0800 |
commit | ccbc2332829569b6bb416ced624ee3123c54b939 (patch) | |
tree | b865d8b499a00921b4b38f2839dfc6c631aa4666 /ui/app/components/user-preferenced-currency-display/user-preferenced-currency-display.container.js | |
parent | f0602ca354a6d352c13a79a1cba884f54e5b9a83 (diff) | |
parent | 1bb4a8428c73c1f1137793b25900db159eec3fa8 (diff) | |
download | tangerine-wallet-browser-ccbc2332829569b6bb416ced624ee3123c54b939.tar.gz tangerine-wallet-browser-ccbc2332829569b6bb416ced624ee3123c54b939.tar.zst tangerine-wallet-browser-ccbc2332829569b6bb416ced624ee3123c54b939.zip |
Merge branch 'develop' of github.com:MetaMask/metamask-extension into sentry-enhancements2
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, |