From 4170e715c85fbc8aa1af1711d68eac683611bb7f Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Sun, 14 Jun 2020 13:34:26 -0400 Subject: [PATCH] Fixed issue with FollowRequests in user_lists reducers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Fixed: - issue with FollowRequests in user_lists reducers --- app/javascript/gabsocial/reducers/user_lists.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/javascript/gabsocial/reducers/user_lists.js b/app/javascript/gabsocial/reducers/user_lists.js index 83dc4f6a..118866eb 100644 --- a/app/javascript/gabsocial/reducers/user_lists.js +++ b/app/javascript/gabsocial/reducers/user_lists.js @@ -121,18 +121,18 @@ export default function userLists(state = initialState, action) { return state.setIn(['liked_by', action.id], ImmutableList(action.accounts.map(item => item.id))); case FOLLOW_REQUESTS_FETCH_SUCCESS: - return state.setIn(['follow_requests', 'items'], ImmutableList(action.accounts.map(item => item.id))).setIn(['follow_requests', 'next'], action.next).setIn(['follow_requests', 'isLoading'], false); + return normalizeList(state, 'follow_requests', me, action.accounts, action.next); case FOLLOW_REQUESTS_EXPAND_SUCCESS: - return state.updateIn(['follow_requests', 'items'], list => list.concat(action.accounts.map(item => item.id))).setIn(['follow_requests', 'next'], action.next).setIn(['follow_requests', 'isLoading'], false); + return appendToList(state, 'follow_requests', action.id, action.accounts, action.next); case FOLLOW_REQUESTS_FETCH_REQUEST: case FOLLOW_REQUESTS_EXPAND_REQUEST: - return state.setIn(['follow_requests', 'isLoading'], true); + return state.setIn(['follow_requests', me, 'isLoading'], true); case FOLLOW_REQUESTS_FETCH_FAIL: case FOLLOW_REQUESTS_EXPAND_FAIL: - return state.setIn(['follow_requests', 'isLoading'], false); + return state.setIn(['follow_requests', me, 'isLoading'], false); case FOLLOW_REQUEST_AUTHORIZE_SUCCESS: case FOLLOW_REQUEST_REJECT_SUCCESS: - return state.updateIn(['follow_requests', 'items'], list => list.filterNot(item => item === action.id)); + return state.updateIn(['follow_requests', me, 'items'], list => list.filterNot(item => item === action.id)); case BLOCKS_FETCH_REQUEST: case BLOCKS_EXPAND_REQUEST: