diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-20 19:39:18 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-20 19:39:58 +0100 |
commit | 38dd85daab8e8342ec608d24cf81254c0dfde95c (patch) | |
tree | 33502dcbfd0af447fb5b1ef7147485c8c9de95b0 /app/assets/javascripts/components/selectors | |
parent | da2ef4d676ff71e6ab3edf8d1a7cee8bf6b6d353 (diff) |
Adding notifications column
Diffstat (limited to 'app/assets/javascripts/components/selectors')
-rw-r--r-- | app/assets/javascripts/components/selectors/index.jsx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/app/assets/javascripts/components/selectors/index.jsx b/app/assets/javascripts/components/selectors/index.jsx index 33b179cb8..20debe604 100644 --- a/app/assets/javascripts/components/selectors/index.jsx +++ b/app/assets/javascripts/components/selectors/index.jsx @@ -1,5 +1,5 @@ import { createSelector } from 'reselect' -import Immutable from 'immutable'; +import Immutable from 'immutable'; const getStatuses = state => state.get('statuses'); const getAccounts = state => state.get('accounts'); @@ -50,9 +50,9 @@ const assembleStatus = (id, statuses, accounts) => { return status.set('reblog', reblog).set('account', accounts.get(status.get('account'))); }; -const getNotificationsBase = state => state.get('notifications'); +const getAlertsBase = state => state.get('alerts'); -export const getNotifications = createSelector([getNotificationsBase], (base) => { +export const getAlerts = createSelector([getAlertsBase], (base) => { let arr = []; base.forEach(item => { @@ -66,3 +66,12 @@ export const getNotifications = createSelector([getNotificationsBase], (base) => return arr; }); + +export const makeGetNotification = () => { + return createSelector([ + (_, base) => base, + (state, _, accountId) => state.getIn(['accounts', accountId]) + ], (base, account) => { + return base.set('account', account); + }); +}; |