Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 95 | Rev 3396 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 95 Rev 816
Línea 1... Línea 1...
1
import { actionsTypes } from "./auth.types";
1
import { actionsTypes } from './auth.types'
Línea 2... Línea 2...
2
 
2
 
3
const initialState = {
3
const initialState = {
4
  access_usign_social_networks: "y",
4
  access_usign_social_networks: 'y',
5
  aes: "",
5
  aes: '',
6
  defaultNetwork: "y",
6
  defaultNetwork: 'y',
7
  email: "",
7
  email: '',
8
  favico_url: "",
8
  favico_url: '',
9
  intro: "",
9
  intro: '',
10
  logo_url: "",
10
  logo_url: '',
11
  navbar_url: "",
11
  navbar_url: '',
12
  remember: true,
12
  remember: true,
13
  site_key: "",
13
  site_key: '',
14
  isAuth: false,
14
  isAuth: false,
15
  theme_id: "1",
15
  theme_id: '1',
16
  jwt: "",
16
  jwt: '',
17
  loading: true,
17
  loading: true
Línea 18... Línea 18...
18
};
18
}
19
 
19
 
Línea 20... Línea 20...
20
const AuthReducer = (state = initialState, action) => {
20
const AuthReducer = (state = initialState, action) => {
21
  const { type, payload } = action;
21
  const { type, payload } = action
22
 
22
 
23
  const actionCases = {
23
  const actionCases = {
24
    [actionsTypes.SET_PERMISSIONS]: { ...state, ...payload },
24
    [actionsTypes.SET_PERMISSIONS]: { ...state, ...payload },
25
    [actionsTypes.LOGIN]: { ...state, isAuth: true },
25
    [actionsTypes.LOGIN]: { ...state, isAuth: true },
26
    [actionsTypes.LOGOUT]: { ...state, isAuth: false },
26
    [actionsTypes.LOGOUT]: { ...state, isAuth: false },
Línea 27... Línea 27...
27
    [actionsTypes.START_LOADING]: { ...state, loading: true },
27
    [actionsTypes.START_LOADING]: { ...state, loading: true },
28
    [actionsTypes.STOP_LOADING]: { ...state, loading: false },
28
    [actionsTypes.STOP_LOADING]: { ...state, loading: false }
Línea 29... Línea 29...
29
  };
29
  }