]> cat aescling's git repositories - mastodon.git/blob - app/javascript/mastodon/reducers/settings.js
Improve eslint rules (#3147)
[mastodon.git] / app / javascript / mastodon / reducers / settings.js
1 import { SETTING_CHANGE } from '../actions/settings';
2 import { STORE_HYDRATE } from '../actions/store';
3 import Immutable from 'immutable';
4
5 const initialState = Immutable.Map({
6 onboarded: false,
7
8 home: Immutable.Map({
9 shows: Immutable.Map({
10 reblog: true,
11 reply: true,
12 }),
13
14 regex: Immutable.Map({
15 body: '',
16 }),
17 }),
18
19 notifications: Immutable.Map({
20 alerts: Immutable.Map({
21 follow: true,
22 favourite: true,
23 reblog: true,
24 mention: true,
25 }),
26
27 shows: Immutable.Map({
28 follow: true,
29 favourite: true,
30 reblog: true,
31 mention: true,
32 }),
33
34 sounds: Immutable.Map({
35 follow: true,
36 favourite: true,
37 reblog: true,
38 mention: true,
39 }),
40 }),
41 });
42
43 export default function settings(state = initialState, action) {
44 switch(action.type) {
45 case STORE_HYDRATE:
46 return state.mergeDeep(action.state.get('settings'));
47 case SETTING_CHANGE:
48 return state.setIn(action.key, action.value);
49 default:
50 return state;
51 }
52 };
This page took 0.08616 seconds and 5 git commands to generate.