diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-13 20:55:24 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-13 20:55:24 +0100 |
commit | 4286d49adebf934c950c97e45ba996253242539b (patch) | |
tree | d4bb4b0e00a6aff13b9036954b51f9bdb7ece6ce /app | |
parent | 44f236e8892796910027824f73a5c83ce36b5fbd (diff) |
Fix another mistake
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/components/reducers/user_lists.jsx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/assets/javascripts/components/reducers/user_lists.jsx b/app/assets/javascripts/components/reducers/user_lists.jsx index de5c85bba..65598f8a0 100644 --- a/app/assets/javascripts/components/reducers/user_lists.jsx +++ b/app/assets/javascripts/components/reducers/user_lists.jsx @@ -19,29 +19,29 @@ const initialState = Immutable.Map({ favourited_by: Immutable.Map() }); -const normalizeList = (state, type, id, accounts, prev) => { +const normalizeList = (state, type, id, accounts, next) => { return state.setIn([type, id], Immutable.Map({ - prev, + next, items: Immutable.List(accounts.map(item => item.id)) })); }; -const appendToList = (state, type, id, accounts, prev) => { +const appendToList = (state, type, id, accounts, next) => { return state.updateIn([type, id], map => { - return map.set('prev', prev).update('items', list => list.push(...accounts.map(item => item.id))); + return map.set('next', next).update('items', list => list.push(...accounts.map(item => item.id))); }); }; export default function userLists(state = initialState, action) { switch(action.type) { case FOLLOWERS_FETCH_SUCCESS: - return normalizeList(state, 'followers', action.id, action.accounts, action.prev); + return normalizeList(state, 'followers', action.id, action.accounts, action.next); case FOLLOWERS_EXPAND_SUCCESS: - return appendToList(state, 'followers', action.id, action.accounts, action.prev); + return appendToList(state, 'followers', action.id, action.accounts, action.next); case FOLLOWING_FETCH_SUCCESS: - return normalizeList(state, 'following', action.id, action.accounts, action.prev); + return normalizeList(state, 'following', action.id, action.accounts, action.next); case FOLLOWING_EXPAND_SUCCESS: - return appendToList(state, 'following', action.id, action.accounts, action.prev); + return appendToList(state, 'following', action.id, action.accounts, action.next); case SUGGESTIONS_FETCH_SUCCESS: return state.set('suggestions', Immutable.List(action.accounts.map(item => item.id))); case REBLOGS_FETCH_SUCCESS: |