Loading indicator on sign in.

This commit is contained in:
Patrick Fic
2021-05-06 15:33:36 -07:00
parent 9d1164496d
commit a568190ebb
3 changed files with 19 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ const INITIAL_STATE = {
//language: "en-US"
},
bodyshop: null,
loginLoading: false,
fingerprint: null,
error: null,
conflict: false,
@@ -26,6 +27,8 @@ const userReducer = (state = INITIAL_STATE, action) => {
return { ...state, conflict: false };
case UserActionTypes.SET_INSTANCE_CONFLICT:
return { ...state, conflict: true };
case UserActionTypes.EMAIL_SIGN_IN_START:
return { ...state, loginLoading: true };
case UserActionTypes.VALIDATE_PASSWORD_RESET_START:
case UserActionTypes.SEND_PASSWORD_RESET_EMAIL_START:
return {
@@ -63,6 +66,7 @@ const userReducer = (state = INITIAL_STATE, action) => {
case UserActionTypes.SIGN_IN_SUCCESS:
return {
...state,
loginLoading: false,
currentUser: action.payload,
error: null,
};
@@ -99,6 +103,7 @@ const userReducer = (state = INITIAL_STATE, action) => {
case UserActionTypes.EMAIL_SIGN_UP_FAILURE:
return {
...state,
loginLoading: false,
error: action.payload,
};
case UserActionTypes.SET_AUTH_LEVEL:

View File

@@ -31,3 +31,8 @@ export const selectAuthLevel = createSelector(
[selectUser],
(user) => user.authLevel
);
export const selectLoginLoading = createSelector(
[selectUser],
(user) => user.loginLoading
);