about summary refs log tree commit diff
path: root/app/assets/javascripts/components/reducers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-04 12:48:53 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-04 12:48:53 +0100
commit98c3a5e9c38b3bc653002dafab0504fdee3d2c44 (patch)
treea3cfa04ca33e9471649b17fbb44ce77365684573 /app/assets/javascripts/components/reducers
parent6d26bfd14706872f6e4d1c3a3e45b00d81cf86cb (diff)
Optimize how statuses are re-rendered and relative time intervals
Diffstat (limited to 'app/assets/javascripts/components/reducers')
-rw-r--r--app/assets/javascripts/components/reducers/user_lists.jsx11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/assets/javascripts/components/reducers/user_lists.jsx b/app/assets/javascripts/components/reducers/user_lists.jsx
index 686179af2..4c201f927 100644
--- a/app/assets/javascripts/components/reducers/user_lists.jsx
+++ b/app/assets/javascripts/components/reducers/user_lists.jsx
@@ -3,13 +3,18 @@ import {
   FOLLOWING_FETCH_SUCCESS
 } from '../actions/accounts';
 import { SUGGESTIONS_FETCH_SUCCESS } from '../actions/suggestions';
-import { REBLOGS_FETCH_SUCCESS } from '../actions/interactions';
+import {
+  REBLOGS_FETCH_SUCCESS,
+  FAVOURITES_FETCH_SUCCESS
+} from '../actions/interactions';
 import Immutable from 'immutable';
 
 const initialState = Immutable.Map({
   followers: Immutable.Map(),
   following: Immutable.Map(),
-  suggestions: Immutable.List()
+  suggestions: Immutable.List(),
+  reblogged_by: Immutable.Map(),
+  favourited_by: Immutable.Map()
 });
 
 export default function userLists(state = initialState, action) {
@@ -22,6 +27,8 @@ export default function userLists(state = initialState, action) {
       return state.set('suggestions', Immutable.List(action.accounts.map(item => item.id)));
     case REBLOGS_FETCH_SUCCESS:
       return state.setIn(['reblogged_by', action.id], Immutable.List(action.accounts.map(item => item.id)));
+    case FAVOURITES_FETCH_SUCCESS:
+      return state.setIn(['favourited_by', action.id], Immutable.List(action.accounts.map(item => item.id)));
     default:
       return state;
   }