AccountTimeline: let it be configurable like other timelines

This commit is contained in:
Alex Gleason
2021-08-11 15:31:46 -05:00
parent 6665efdc1e
commit dcf7dd216f
7 changed files with 108 additions and 54 deletions

View File

@@ -1,25 +1,10 @@
import { connect } from 'react-redux';
import StatusList from '../../../components/status_list';
import { Map as ImmutableMap, OrderedSet as ImmutableOrderedSet } from 'immutable';
import { createSelector } from 'reselect';
import { OrderedSet as ImmutableOrderedSet } from 'immutable';
import { makeGetStatusIds } from 'soapbox/selectors';
import { debounce } from 'lodash';
import { dequeueTimeline } from 'soapbox/actions/timelines';
import { scrollTopTimeline } from '../../../actions/timelines';
import { getSettings } from 'soapbox/actions/settings';
import { shouldFilter } from 'soapbox/utils/timelines';
const makeGetStatusIds = () => createSelector([
(state, { type }) => getSettings(state).get(type, ImmutableMap()),
(state, { type }) => state.getIn(['timelines', type, 'items'], ImmutableOrderedSet()),
(state) => state.get('statuses'),
(state) => state.get('me'),
], (columnSettings, statusIds, statuses, me) => {
return statusIds.filter(id => {
const status = statuses.get(id);
if (!status) return true;
return !shouldFilter(status, columnSettings);
});
});
const makeMapStateToProps = () => {
const getStatusIds = makeGetStatusIds();