2020-01-09 04:34:58 +01:00
|
|
|
import extend from 'xtend'
|
|
|
|
import { actionConstants } from '../../store/actions'
|
2018-03-16 01:29:45 +01:00
|
|
|
|
2020-01-09 04:34:58 +01:00
|
|
|
export default reduceMetamask
|
2018-03-16 01:29:45 +01:00
|
|
|
|
|
|
|
function reduceMetamask (state, action) {
|
|
|
|
const localeMessagesState = extend({}, state.localeMessages)
|
|
|
|
|
|
|
|
switch (action.type) {
|
2020-01-09 04:34:58 +01:00
|
|
|
case actionConstants.SET_CURRENT_LOCALE:
|
2018-03-22 01:41:47 +01:00
|
|
|
return extend(localeMessagesState, {
|
2019-09-06 15:47:07 +02:00
|
|
|
current: action.value.messages,
|
2018-03-22 01:41:47 +01:00
|
|
|
})
|
2018-03-16 01:29:45 +01:00
|
|
|
default:
|
|
|
|
return localeMessagesState
|
|
|
|
}
|
|
|
|
}
|