mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2026-03-10 21:25:04 +00:00
Display loading icon when the user logs in or signs up
This commit is contained in:
@@ -9,6 +9,7 @@ export const getUserData = () => (dispatch) => {
|
||||
type: SET_USER,
|
||||
payload: res.data,
|
||||
})
|
||||
dispatch({ type: CLEAR_ERRORS })
|
||||
})
|
||||
.catch((err) => console.error(err));
|
||||
}
|
||||
@@ -21,7 +22,7 @@ export const loginUser = (loginData, history) => (dispatch) => {
|
||||
// Save the login token
|
||||
setAuthorizationHeader(res.data.token);
|
||||
dispatch(getUserData());
|
||||
dispatch({ type: CLEAR_ERRORS })
|
||||
// dispatch({ type: CLEAR_ERRORS })
|
||||
// Redirects to home page
|
||||
history.push('/home');
|
||||
})
|
||||
@@ -43,7 +44,7 @@ export const signupUser = (newUserData, history) => (dispatch) => {
|
||||
// Save the signup token
|
||||
setAuthorizationHeader(res.data.token);
|
||||
dispatch(getUserData());
|
||||
dispatch({ type: CLEAR_ERRORS })
|
||||
// dispatch({ type: CLEAR_ERRORS })
|
||||
// Redirects to home page
|
||||
history.push('/home');
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user