Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 5 Rev 32
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
  loading: true,
17
  loading: true,
Línea 17... Línea 18...
17
}
18
};
18
 
19
 
Línea 19... Línea 20...
19
const AuthReducer = (state = initialState, action) => {
20
const AuthReducer = (state = initialState, action) => {
20
  const { type, payload } = action
21
  const { type, payload } = action;
21
 
22
 
22
  const actionCases = {
23
  const actionCases = {
23
    [actionsTypes.SET_PERMISSIONS]: { ...state, ...payload },
24
    [actionsTypes.SET_PERMISSIONS]: { ...state, ...payload },
24
    [actionsTypes.LOGIN]: { ...state, isAuth: true },
25
    [actionsTypes.LOGIN]: { ...state, isAuth: true },
25
    [actionsTypes.LOGOUT]: { ...state, isAuth: false },
26
    [actionsTypes.LOGOUT]: { ...state, isAuth: false },
Línea 26... Línea 27...
26
    [actionsTypes.START_LOADING]: { ...state, loading: true },
27
    [actionsTypes.START_LOADING]: { ...state, loading: true },
27
    [actionsTypes.STOP_LOADING]: { ...state, loading: false },
28
    [actionsTypes.STOP_LOADING]: { ...state, loading: false },
Línea 28... Línea 29...
28
  }
29
  };