Removed domain blocks
• Removed: - domain blocks as we are not using any other domains than gab.com
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
import {
|
||||
DOMAIN_BLOCKS_FETCH_SUCCESS,
|
||||
DOMAIN_BLOCKS_EXPAND_SUCCESS,
|
||||
DOMAIN_UNBLOCK_SUCCESS,
|
||||
} from '../actions/domain_blocks';
|
||||
import { Map as ImmutableMap, OrderedSet as ImmutableOrderedSet } from 'immutable';
|
||||
|
||||
const initialState = ImmutableMap({
|
||||
blocks: ImmutableMap({
|
||||
items: ImmutableOrderedSet(),
|
||||
}),
|
||||
});
|
||||
|
||||
export default function domainLists(state = initialState, action) {
|
||||
switch(action.type) {
|
||||
case DOMAIN_BLOCKS_FETCH_SUCCESS:
|
||||
return state.setIn(['blocks', 'items'], ImmutableOrderedSet(action.domains)).setIn(['blocks', 'next'], action.next);
|
||||
case DOMAIN_BLOCKS_EXPAND_SUCCESS:
|
||||
return state.updateIn(['blocks', 'items'], set => set.union(action.domains)).setIn(['blocks', 'next'], action.next);
|
||||
case DOMAIN_UNBLOCK_SUCCESS:
|
||||
return state.updateIn(['blocks', 'items'], set => set.delete(action.domain));
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
@@ -6,7 +6,6 @@ import compose from './compose'
|
||||
import contexts from './contexts'
|
||||
import conversations from './conversations'
|
||||
import custom_emojis from './custom_emojis'
|
||||
import domain_lists from './domain_lists'
|
||||
import filters from './filters'
|
||||
import gab_trends from './gab_trends'
|
||||
import groups from './groups'
|
||||
@@ -47,7 +46,6 @@ const reducers = {
|
||||
contexts,
|
||||
conversations,
|
||||
custom_emojis,
|
||||
domain_lists,
|
||||
filters,
|
||||
gab_trends,
|
||||
groups,
|
||||
|
||||
@@ -13,10 +13,6 @@ import {
|
||||
ACCOUNT_UNPIN_SUCCESS,
|
||||
RELATIONSHIPS_FETCH_SUCCESS,
|
||||
} from '../actions/accounts';
|
||||
import {
|
||||
DOMAIN_BLOCK_SUCCESS,
|
||||
DOMAIN_UNBLOCK_SUCCESS,
|
||||
} from '../actions/domain_blocks';
|
||||
import { Map as ImmutableMap, fromJS } from 'immutable';
|
||||
|
||||
const normalizeRelationship = (state, relationship) => state.set(relationship.id, fromJS(relationship));
|
||||
@@ -29,14 +25,6 @@ const normalizeRelationships = (state, relationships) => {
|
||||
return state;
|
||||
};
|
||||
|
||||
const setDomainBlocking = (state, accounts, blocking) => {
|
||||
return state.withMutations(map => {
|
||||
accounts.forEach(id => {
|
||||
map.setIn([id, 'domain_blocking'], blocking);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const initialState = ImmutableMap();
|
||||
|
||||
export default function relationships(state = initialState, action) {
|
||||
@@ -60,10 +48,6 @@ export default function relationships(state = initialState, action) {
|
||||
return normalizeRelationship(state, action.relationship);
|
||||
case RELATIONSHIPS_FETCH_SUCCESS:
|
||||
return normalizeRelationships(state, action.relationships);
|
||||
case DOMAIN_BLOCK_SUCCESS:
|
||||
return setDomainBlocking(state, action.accounts, true);
|
||||
case DOMAIN_UNBLOCK_SUCCESS:
|
||||
return setDomainBlocking(state, action.accounts, false);
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user