diff options
author | kibigo! <marrus-sh@users.noreply.github.com> | 2017-12-03 23:26:40 -0800 |
---|---|---|
committer | kibigo! <marrus-sh@users.noreply.github.com> | 2017-12-03 23:26:40 -0800 |
commit | bc4fa6b198557a7f3989eb0865e2c77ac7451d29 (patch) | |
tree | a18543e1e0555e88b97cad60adc6d2abe0bffb00 /app/javascript/themes/glitch/reducers/push_notifications.js | |
parent | d216547382cf1f3419de31e1ee06272e816ea339 (diff) |
Rename themes -> flavours ? ?
Diffstat (limited to 'app/javascript/themes/glitch/reducers/push_notifications.js')
-rw-r--r-- | app/javascript/themes/glitch/reducers/push_notifications.js | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/app/javascript/themes/glitch/reducers/push_notifications.js b/app/javascript/themes/glitch/reducers/push_notifications.js deleted file mode 100644 index 744e4a0eb..000000000 --- a/app/javascript/themes/glitch/reducers/push_notifications.js +++ /dev/null @@ -1,51 +0,0 @@ -import { STORE_HYDRATE } from 'themes/glitch/actions/store'; -import { SET_BROWSER_SUPPORT, SET_SUBSCRIPTION, CLEAR_SUBSCRIPTION, ALERTS_CHANGE } from 'themes/glitch/actions/push_notifications'; -import Immutable from 'immutable'; - -const initialState = Immutable.Map({ - subscription: null, - alerts: new Immutable.Map({ - follow: false, - favourite: false, - reblog: false, - mention: false, - }), - isSubscribed: false, - browserSupport: false, -}); - -export default function push_subscriptions(state = initialState, action) { - switch(action.type) { - case STORE_HYDRATE: { - const push_subscription = action.state.get('push_subscription'); - - if (push_subscription) { - return state - .set('subscription', new Immutable.Map({ - id: push_subscription.get('id'), - endpoint: push_subscription.get('endpoint'), - })) - .set('alerts', push_subscription.get('alerts') || initialState.get('alerts')) - .set('isSubscribed', true); - } - - return state; - } - case SET_SUBSCRIPTION: - return state - .set('subscription', new Immutable.Map({ - id: action.subscription.id, - endpoint: action.subscription.endpoint, - })) - .set('alerts', new Immutable.Map(action.subscription.alerts)) - .set('isSubscribed', true); - case SET_BROWSER_SUPPORT: - return state.set('browserSupport', action.value); - case CLEAR_SUBSCRIPTION: - return initialState; - case ALERTS_CHANGE: - return state.setIn(action.key, action.value); - default: - return state; - } -}; |