web: Added lodash
This commit is contained in:
parent
f8f03a056c
commit
1e5b41ce07
@ -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",
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user