2017-01-09 08:00:55 -05:00
|
|
|
import { SETTING_CHANGE } from '../actions/settings';
|
|
|
|
import { STORE_HYDRATE } from '../actions/store';
|
|
|
|
import Immutable from 'immutable';
|
|
|
|
|
|
|
|
const initialState = Immutable.Map({
|
2017-04-16 14:32:00 -04:00
|
|
|
onboarded: false,
|
|
|
|
|
2017-01-10 11:25:10 -05:00
|
|
|
home: Immutable.Map({
|
|
|
|
shows: Immutable.Map({
|
|
|
|
reblog: true,
|
|
|
|
reply: true
|
2017-05-02 20:04:16 -04:00
|
|
|
}),
|
|
|
|
|
|
|
|
regex: Immutable.Map({
|
|
|
|
body: ''
|
2017-01-10 11:25:10 -05:00
|
|
|
})
|
|
|
|
}),
|
|
|
|
|
2017-01-09 08:00:55 -05: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 14:09:03 -05:00
|
|
|
}),
|
|
|
|
|
|
|
|
sounds: Immutable.Map({
|
|
|
|
follow: true,
|
|
|
|
favourite: true,
|
|
|
|
reblog: true,
|
|
|
|
mention: true
|
2017-01-09 08:00:55 -05:00
|
|
|
})
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
|
|
|
export default function settings(state = initialState, action) {
|
|
|
|
switch(action.type) {
|
|
|
|
case STORE_HYDRATE:
|
2017-01-17 14:09:03 -05:00
|
|
|
return state.mergeDeep(action.state.get('settings'));
|
2017-01-09 08:00:55 -05:00
|
|
|
case SETTING_CHANGE:
|
|
|
|
return state.setIn(action.key, action.value);
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
};
|