2017-01-09 13:00:55 +00:00
|
|
|
import { SETTING_CHANGE } from '../actions/settings';
|
|
|
|
import { STORE_HYDRATE } from '../actions/store';
|
|
|
|
import Immutable from 'immutable';
|
|
|
|
|
|
|
|
const initialState = Immutable.Map({
|
2017-01-10 16:25:10 +00:00
|
|
|
home: Immutable.Map({
|
|
|
|
shows: Immutable.Map({
|
|
|
|
reblog: true,
|
|
|
|
reply: true
|
|
|
|
})
|
|
|
|
}),
|
|
|
|
|
2017-01-09 13:00:55 +00:00
|
|
|
notifications: Immutable.Map({
|
|
|
|
alerts: Immutable.Map({
|
|
|
|
follow: true,
|
|
|
|
favourite: true,
|
|
|
|
reblog: true,
|
|
|
|
mention: true
|
|
|
|
}),
|
|
|
|
|
|
|
|
shows: Immutable.Map({
|
|
|
|
follow: true,
|
|
|
|
favourite: true,
|
|
|
|
reblog: true,
|
|
|
|
mention: true
|
2017-01-17 19:09:03 +00:00
|
|
|
}),
|
|
|
|
|
|
|
|
sounds: Immutable.Map({
|
|
|
|
follow: true,
|
|
|
|
favourite: true,
|
|
|
|
reblog: true,
|
|
|
|
mention: true
|
2017-01-09 13:00:55 +00:00
|
|
|
})
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
|
|
|
export default function settings(state = initialState, action) {
|
|
|
|
switch(action.type) {
|
|
|
|
case STORE_HYDRATE:
|
2017-01-17 19:09:03 +00:00
|
|
|
return state.mergeDeep(action.state.get('settings'));
|
2017-01-09 13:00:55 +00:00
|
|
|
case SETTING_CHANGE:
|
|
|
|
return state.setIn(action.key, action.value);
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
};
|