equal
deleted
inserted
replaced
|
1 // Selectors linked to the authentication status |
|
2 |
|
3 export const getOnline = state => state.getIn(["status", 'online']) |
|
4 |
|
5 export const getToken = state => state.getIn(['authStatus','token']) |
|
6 |
|
7 export const isAuthenticated = state => state.getIn(['authStatus', 'isAuthenticated']) |
|
8 |
|
9 export const getCurrentUser = state => state.getIn(['authStatus', 'currentUser']) |
|
10 |
|
11 export const getClientId = state => state.getIn(['authStatus', 'clientId']) |
|
12 |
|
13 export const getCurrentGroupName = state => state.getIn(['authStatus', 'currentGroup']) |
|
14 |
|
15 export const getGroups = state => state.get('groups') |
|
16 |
|
17 export const getCurrentGroup = state => { |
|
18 const groupName = getCurrentGroupName(state); |
|
19 const groups = getGroups(state); |
|
20 if(groups) { |
|
21 return groups.find( g => g.get('name') === groupName ); |
|
22 } else { |
|
23 return null; |
|
24 } |
|
25 } |
|
26 |
|
27 export const getCreateGroup = state => state.get('createGroup') |
|
28 |
|
29 |
|
30 |