about summary refs log tree commit diff
path: root/app/assets/javascripts/components/reducers/notifications.jsx
diff options
context:
space:
mode:
authorAnthony Bellew <anthonyreflected@gmail.com>2017-01-03 11:51:35 -0700
committerGitHub <noreply@github.com>2017-01-03 11:51:35 -0700
commitde154dbd5dbb04d083f5a66dc288d9fef7006c01 (patch)
tree88a1715021c33add55501351dbf74950deeac481 /app/assets/javascripts/components/reducers/notifications.jsx
parentc3e9ba6a66bfcb9e33edebc73adea0a17d7f02a6 (diff)
parente6657d7342ee1ce08973bf1e5ab89e423eb8b760 (diff)
Merge pull request #1 from Gargron/master
Catchup merge
Diffstat (limited to 'app/assets/javascripts/components/reducers/notifications.jsx')
-rw-r--r--app/assets/javascripts/components/reducers/notifications.jsx23
1 files changed, 21 insertions, 2 deletions
diff --git a/app/assets/javascripts/components/reducers/notifications.jsx b/app/assets/javascripts/components/reducers/notifications.jsx
index 617a833d2..e0d1ccf83 100644
--- a/app/assets/javascripts/components/reducers/notifications.jsx
+++ b/app/assets/javascripts/components/reducers/notifications.jsx
@@ -1,7 +1,8 @@
 import {
   NOTIFICATIONS_UPDATE,
   NOTIFICATIONS_REFRESH_SUCCESS,
-  NOTIFICATIONS_EXPAND_SUCCESS
+  NOTIFICATIONS_EXPAND_SUCCESS,
+  NOTIFICATIONS_SETTING_CHANGE
 } from '../actions/notifications';
 import { ACCOUNT_BLOCK_SUCCESS } from '../actions/accounts';
 import Immutable from 'immutable';
@@ -9,7 +10,23 @@ import Immutable from 'immutable';
 const initialState = Immutable.Map({
   items: Immutable.List(),
   next: null,
-  loaded: false
+  loaded: false,
+
+  settings: Immutable.Map({
+    alerts: Immutable.Map({
+      follow: true,
+      favourite: true,
+      reblog: true,
+      mention: true
+    }),
+
+    shows: Immutable.Map({
+      follow: true,
+      favourite: true,
+      reblog: true,
+      mention: true
+    })
+  })
 });
 
 const notificationToMap = notification => Immutable.Map({
@@ -58,6 +75,8 @@ export default function notifications(state = initialState, action) {
       return appendNormalizedNotifications(state, action.notifications, action.next);
     case ACCOUNT_BLOCK_SUCCESS:
       return filterNotifications(state, action.relationship);
+    case NOTIFICATIONS_SETTING_CHANGE:
+      return state.setIn(['settings', ...action.key], action.checked);
     default:
       return state;
   }