about summary refs log tree commit diff
path: root/app/assets/javascripts/components/selectors/index.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/components/selectors/index.jsx')
-rw-r--r--app/assets/javascripts/components/selectors/index.jsx15
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);
+  });
+};