Replaced remaining parts of app to use Redux.
This commit is contained in:
@@ -2,7 +2,8 @@ import UserActionTypes from "./user.types";
|
||||
|
||||
const INITIAL_STATE = {
|
||||
currentUser: {
|
||||
authorized: null
|
||||
authorized: null,
|
||||
language: "en_US"
|
||||
},
|
||||
error: null
|
||||
};
|
||||
@@ -27,9 +28,15 @@ const userReducer = (state = INITIAL_STATE, action) => {
|
||||
error: null,
|
||||
currentUser: { authorized: false }
|
||||
};
|
||||
case UserActionTypes.SET_USER_LANGUAGE:
|
||||
return {
|
||||
...state,
|
||||
language: action.payload
|
||||
};
|
||||
case UserActionTypes.SIGN_IN_FAILURE:
|
||||
case UserActionTypes.SIGN_OUT_FAILURE:
|
||||
case UserActionTypes.EMAIL_SIGN_UP_FAILURE:
|
||||
console.log("Reduced getting called.");
|
||||
return {
|
||||
...state,
|
||||
error: action.payload
|
||||
|
||||
Reference in New Issue
Block a user