Tanya Sashyna пре 5 година
родитељ
комит
e65497d62c
4 измењених фајлова са 4 додато и 4 уклоњено
  1. 1 1
      src/conteiners/login/Login.js
  2. 1 1
      src/conteiners/profile/Profile.js
  3. 1 1
      src/reducers/login.js
  4. 1 1
      src/router.js

+ 1 - 1
src/conteiners/login/Login.js

@@ -10,7 +10,7 @@ import LoginForm from '../../components/login-form/LoginForm';
 
 export class Login extends React.Component {
     render() {
-        const { postLoginSubmit, message, user } = this.props;
+        const { postLoginSubmit, message } = this.props;
         return (
             <div className="login-page">
                 <div className="form-login">

+ 1 - 1
src/conteiners/profile/Profile.js

@@ -20,7 +20,7 @@ export class Profile extends React.Component {
         //console.log('profileUser',JSON.parse(localStorage.user).user._id);
         //const user = JSON.parse(localStorage.user).user;
         const { user } = this.props;
-        console.log('user',user);
+        //console.log('user',user);
     
         return (
             <>

+ 1 - 1
src/reducers/login.js

@@ -12,7 +12,7 @@ export default (state = initialState, action) => {
         }
 
         case types.POST_REQUEST_SUCCESS_LOGIN: {   
-            console.log('action.payload.user',action.payload.message);
+            //console.log('action.payload.user',action.payload.message);
             return {
                 ...state,
                 user: action.payload.user,

+ 1 - 1
src/router.js

@@ -136,7 +136,7 @@ const route = [
 
 const Router = withRouter(({ history, user }) => {
 	useEffect(() => {
-		const userl = JSON.parse(localStorage.user).user; 
+		const userl = localStorage.user ? JSON.parse(localStorage.user).user : null;
 
 		if (userl) {
 			const userRole = userl.role;