|
|
@ -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 |
|
|
|
} |
|
|
|
|
|
|
|