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