1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Always return a Boolean from getShowFiatSelector (#8585)

`getShowFiatSelector` would return the `showFiatInTestnets` value
directly when on mainnet, which could be `undefined`. Now it is cast to
a Boolean instead.

This was done to fix a PropType warning in a component that will be
included in a future PR, where this selector was used for a required
prop.
This commit is contained in:
Mark Stacey 2020-05-13 11:53:27 -03:00 committed by GitHub
parent de02eeefbe
commit f9eb1440e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -288,7 +288,7 @@ export function preferencesSelector ({ metamask }) {
export function getShouldShowFiat (state) { export function getShouldShowFiat (state) {
const isMainNet = getIsMainnet(state) const isMainNet = getIsMainnet(state)
const { showFiatInTestnets } = preferencesSelector(state) const { showFiatInTestnets } = preferencesSelector(state)
return isMainNet || showFiatInTestnets return Boolean(isMainNet || showFiatInTestnets)
} }
export function getAdvancedInlineGasShown (state) { export function getAdvancedInlineGasShown (state) {