Updated group_removed_accounts redux value
• Updated: - group_removed_accounts redux value
This commit is contained in:
parent
14927ac227
commit
c4fdd36190
@ -396,8 +396,8 @@ export function expandRemovedAccounts(id) {
|
||||
return (dispatch, getState) => {
|
||||
if (!me) return;
|
||||
|
||||
const url = getState().getIn(['user_lists', 'groups_removed_accounts', id, 'next']);
|
||||
const isLoading = getState().getIn(['user_lists', 'groups_removed_accounts', id, 'isLoading'])
|
||||
const url = getState().getIn(['user_lists', 'group_removed_accounts', id, 'next']);
|
||||
const isLoading = getState().getIn(['user_lists', 'group_removed_accounts', id, 'isLoading'])
|
||||
|
||||
if (url === null || isLoading) return
|
||||
|
||||
|
@ -85,8 +85,8 @@ const mapStateToProps = (state, { params }) => {
|
||||
return {
|
||||
group,
|
||||
groupId,
|
||||
accountIds: state.getIn(['user_lists', 'groups_removed_accounts', groupId, 'items']),
|
||||
hasMore: !!state.getIn(['user_lists', 'groups_removed_accounts', groupId, 'next']),
|
||||
accountIds: state.getIn(['user_lists', 'group_removed_accounts', groupId, 'items']),
|
||||
hasMore: !!state.getIn(['user_lists', 'group_removed_accounts', groupId, 'next']),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ const initialState = ImmutableMap({
|
||||
blocks: ImmutableMap(),
|
||||
mutes: ImmutableMap(),
|
||||
groups: ImmutableMap(),
|
||||
groups_removed_accounts: ImmutableMap(),
|
||||
group_removed_accounts: ImmutableMap(),
|
||||
});
|
||||
|
||||
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);
|
||||
|
||||
case GROUP_REMOVED_ACCOUNTS_FETCH_SUCCESS:
|
||||
return normalizeList(state, 'groups_removed_accounts', action.id, action.accounts, action.next);
|
||||
case GROUP_REMOVED_ACCOUNTS_EXPAND_SUCCESS:
|
||||
return appendToList(state, 'groups_removed_accounts', action.id, action.accounts, action.next);
|
||||
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:
|
||||
return state;
|
||||
|
Loading…
x
Reference in New Issue
Block a user