* Add keyword filtering GET|POST /api/v1/filters GET|PUT|DELETE /api/v1/filters/:id - Irreversible filters can drop toots from home or notifications - Other filters can hide toots through the client app - Filters use a phrase valid in particular contexts, expiration * Make sure expired filters don't get applied client-side * Add missing API methods * Remove "regex filter" from column settings * Add tests * Add test for FeedManager * Add CustomFilter test * Add UI for managing filters * Add streaming API event to allow syncing filters * Fix tests
26 lines
647 B
JavaScript
26 lines
647 B
JavaScript
import api from '../api';
|
|
|
|
export const FILTERS_FETCH_REQUEST = 'FILTERS_FETCH_REQUEST';
|
|
export const FILTERS_FETCH_SUCCESS = 'FILTERS_FETCH_SUCCESS';
|
|
export const FILTERS_FETCH_FAIL = 'FILTERS_FETCH_FAIL';
|
|
|
|
export const fetchFilters = () => (dispatch, getState) => {
|
|
dispatch({
|
|
type: FILTERS_FETCH_REQUEST,
|
|
skipLoading: true,
|
|
});
|
|
|
|
api(getState)
|
|
.get('/api/v1/filters')
|
|
.then(({ data }) => dispatch({
|
|
type: FILTERS_FETCH_SUCCESS,
|
|
filters: data,
|
|
skipLoading: true,
|
|
}))
|
|
.catch(err => dispatch({
|
|
type: FILTERS_FETCH_FAIL,
|
|
err,
|
|
skipLoading: true,
|
|
skipAlert: true,
|
|
}));
|
|
};
|