Replaced remaining parts of app to use Redux.

This commit is contained in:
Patrick Fic
2020-01-31 13:57:27 -08:00
parent 3060c16dd3
commit e2518a95ab
12 changed files with 104 additions and 168 deletions

View File

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