2018-09-04 14:29:20 +00:00
|
|
|
import { SORT_PREFERENCES } from '../actions/actionsTypes';
|
|
|
|
|
|
|
|
const initialState = {
|
|
|
|
sortBy: 'activity',
|
2018-12-05 20:52:08 +00:00
|
|
|
groupByType: false,
|
|
|
|
showFavorites: false,
|
|
|
|
showUnread: false
|
2018-09-04 14:29:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default (state = initialState, action) => {
|
|
|
|
switch (action.type) {
|
|
|
|
case SORT_PREFERENCES.SET_ALL:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
...action.preferences
|
|
|
|
};
|
|
|
|
case SORT_PREFERENCES.SET:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
...action.preference
|
|
|
|
};
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
};
|