Browse Source

fix currency settings

master
Gaëtan Renaudeau 7 years ago
parent
commit
6a57508857
  1. 6
      src/reducers/settings.js

6
src/reducers/settings.js

@ -177,18 +177,12 @@ export const getOrderAccounts = (state: State) => state.settings.orderAccounts
export const areSettingsLoaded = (state: State) => state.settings.loaded
// TODO: avoid this memoize hack (i thought reselect was doing it for us)
const __memoizedCurrencySettingsLocaleValues = {}
export const currencySettingsLocaleSelector = (
settings: SettingsState,
currency: Currency,
): CurrencySettings => {
if (__memoizedCurrencySettingsLocaleValues[currency.id]) {
return __memoizedCurrencySettingsLocaleValues[currency.id]
}
const currencySettings = settings.currenciesSettings[currency.id]
const val = { ...defaultsForCurrency(currency), ...currencySettings }
__memoizedCurrencySettingsLocaleValues[currency.id] = val
return val
}

Loading…
Cancel
Save