diff options
author | Eugen <eugen@zeonfederated.com> | 2017-04-11 22:53:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-11 22:53:58 +0200 |
commit | b22b2cbfacdaef2441d14f401c95863d8ca2e66c (patch) | |
tree | 0fe5d26908e2ba5cea36a7698d06e4fdcfc52021 /app/assets/javascripts/components/actions | |
parent | 2f2b84bfbbfa21a09e03dca05e159aadb70d2232 (diff) |
Fix #1491 - Fix broken notifications, broken Link header parsing for exclude_types (#1548)
Diffstat (limited to 'app/assets/javascripts/components/actions')
-rw-r--r-- | app/assets/javascripts/components/actions/notifications.jsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/components/actions/notifications.jsx b/app/assets/javascripts/components/actions/notifications.jsx index 11e814e1f..b09ca0854 100644 --- a/app/assets/javascripts/components/actions/notifications.jsx +++ b/app/assets/javascripts/components/actions/notifications.jsx @@ -50,6 +50,8 @@ export function updateNotifications(notification, intlMessages, intlLocale) { }; }; +const excludeTypesFromSettings = state => state.getIn(['settings', 'notifications', 'shows']).filter(enabled => !enabled).keySeq().toJS(); + export function refreshNotifications() { return (dispatch, getState) => { dispatch(refreshNotificationsRequest()); @@ -61,7 +63,7 @@ export function refreshNotifications() { params.since_id = ids.first().get('id'); } - params.exclude_types = getState().getIn(['settings', 'notifications', 'shows']).filter(enabled => !enabled).keySeq().toJS(); + params.exclude_types = excludeTypesFromSettings(getState()); api(getState).get('/api/v1/notifications', { params }).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); @@ -109,7 +111,7 @@ export function expandNotifications() { const params = {}; - params.exclude_types = getState().getIn(['settings', 'notifications', 'shows']).filter(enabled => !enabled).keySeq().toJS(); + params.exclude_types = excludeTypesFromSettings(getState()); api(getState).get(url, params).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); |