- Linting... Prettier...
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import { SET_ACTIVE_EVENT, UNSET_ACTIVE_EVENT } from '../constants/actionTypes.js';
|
||||
import { EVENTS_LOADED, SET_ACTIVE_EVENT, UNSET_ACTIVE_EVENT } from '../constants/actionTypes.js';
|
||||
|
||||
export const activeEvent = (state = null, action) => {
|
||||
switch (action.type) {
|
||||
case SET_ACTIVE_EVENT:
|
||||
return action.payload;
|
||||
case UNSET_ACTIVE_EVENT:
|
||||
return null;
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
switch (action.type) {
|
||||
case EVENTS_LOADED:
|
||||
return action.payload.size === 1 ? action.payload.get(0).get('id') : null;
|
||||
case SET_ACTIVE_EVENT:
|
||||
return action.payload;
|
||||
case UNSET_ACTIVE_EVENT:
|
||||
return null;
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user