web: Added lodash

This commit is contained in:
Alexey Safronov 2019-05-30 16:44:57 +03:00
parent f8f03a056c
commit 1e5b41ce07
2 changed files with 6 additions and 3 deletions

View File

@ -26,7 +26,9 @@
"reactstrap": "8.0.0",
"redux": "4.0.1",
"redux-thunk": "2.3.0",
"universal-cookie": "^4.0.0"
"universal-cookie": "^4.0.0",
"lodash": "4.17.11",
"lodash-es": "4.17.11"
},
"devDependencies": {
"ajv": "^6.10.0",

View File

@ -1,4 +1,5 @@
import { SET_CURRENT_USER, SET_MODULES } from '../actions/actionTypes'
import { SET_CURRENT_USER, SET_MODULES } from '../actions/actionTypes';
import isEmpty from 'lodash/isEmpty';
const initialState = {
isAuthenticated: false,
@ -10,7 +11,7 @@ const auth = (state = initialState, action) => {
switch (action.type) {
case SET_CURRENT_USER:
return Object.assign({}, state, {
isAuthenticated: !action.user,
isAuthenticated: !isEmpty(action.user),
user: action.user
});
case SET_MODULES: