Updated group_removed_accounts redux value

• Updated:
- group_removed_accounts redux value
This commit is contained in:
mgabdev 2020-09-10 15:24:38 -05:00
parent 14927ac227
commit c4fdd36190
3 changed files with 6 additions and 8 deletions

View File

@ -396,8 +396,8 @@ export function expandRemovedAccounts(id) {
return (dispatch, getState) => { return (dispatch, getState) => {
if (!me) return; if (!me) return;
const url = getState().getIn(['user_lists', 'groups_removed_accounts', id, 'next']); const url = getState().getIn(['user_lists', 'group_removed_accounts', id, 'next']);
const isLoading = getState().getIn(['user_lists', 'groups_removed_accounts', id, 'isLoading']) const isLoading = getState().getIn(['user_lists', 'group_removed_accounts', id, 'isLoading'])
if (url === null || isLoading) return if (url === null || isLoading) return

View File

@ -85,8 +85,8 @@ const mapStateToProps = (state, { params }) => {
return { return {
group, group,
groupId, groupId,
accountIds: state.getIn(['user_lists', 'groups_removed_accounts', groupId, 'items']), accountIds: state.getIn(['user_lists', 'group_removed_accounts', groupId, 'items']),
hasMore: !!state.getIn(['user_lists', 'groups_removed_accounts', groupId, 'next']), hasMore: !!state.getIn(['user_lists', 'group_removed_accounts', groupId, 'next']),
} }
} }

View File

@ -59,7 +59,7 @@ const initialState = ImmutableMap({
blocks: ImmutableMap(), blocks: ImmutableMap(),
mutes: ImmutableMap(), mutes: ImmutableMap(),
groups: ImmutableMap(), groups: ImmutableMap(),
groups_removed_accounts: ImmutableMap(), group_removed_accounts: ImmutableMap(),
}); });
const setListFailed = (state, type, id) => { const setListFailed = (state, type, id) => {
@ -162,11 +162,9 @@ export default function userLists(state = initialState, action) {
return appendToList(state, 'groups', action.id, action.accounts, action.next); return appendToList(state, 'groups', action.id, action.accounts, action.next);
case GROUP_REMOVED_ACCOUNTS_FETCH_SUCCESS: case GROUP_REMOVED_ACCOUNTS_FETCH_SUCCESS:
return normalizeList(state, 'groups_removed_accounts', action.id, action.accounts, action.next);
case GROUP_REMOVED_ACCOUNTS_EXPAND_SUCCESS: case GROUP_REMOVED_ACCOUNTS_EXPAND_SUCCESS:
return appendToList(state, 'groups_removed_accounts', action.id, action.accounts, action.next);
case GROUP_REMOVED_ACCOUNTS_REMOVE_SUCCESS: case GROUP_REMOVED_ACCOUNTS_REMOVE_SUCCESS:
return state.updateIn(['groups_removed_accounts', action.groupId, 'items'], list => list.filterNot(item => item === action.id)); return state.updateIn(['group_removed_accounts', action.groupId, 'items'], list => list.filterNot(item => item === action.id));
default: default:
return state; return state;