mirror of
https://github.com/franjsco/tick3t
synced 2024-12-28 02:11:32 +01:00
fix: initial State user reducer
This commit is contained in:
parent
95f98ba1c7
commit
6b92560620
@ -2,7 +2,11 @@ import { userConstants } from '../_constants/user.constants';
|
|||||||
|
|
||||||
let userLocalStorage = JSON.parse(localStorage.getItem('user'));
|
let userLocalStorage = JSON.parse(localStorage.getItem('user'));
|
||||||
|
|
||||||
const initialState = userLocalStorage ? { loggedIn: true } : { loggedIn: false};
|
|
||||||
|
const initialState = userLocalStorage ? {loggedIn: true} : {loggedIn: false};
|
||||||
|
|
||||||
|
console.log(initialState);
|
||||||
|
|
||||||
|
|
||||||
export function user(state = initialState, action) {
|
export function user(state = initialState, action) {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
@ -34,7 +38,7 @@ export function user(state = initialState, action) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return {};
|
return state;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user