group timeline improvements and prep for sorting

This commit is contained in:
2458773093
2019-08-09 03:41:56 +03:00
parent f7118a39df
commit 57ddfabf20
3 changed files with 25 additions and 5 deletions

View File

@@ -8,8 +8,8 @@ import { dequeueTimeline } from 'gabsocial/actions/timelines';
import { scrollTopTimeline } from '../../../actions/timelines';
const makeGetStatusIds = () => createSelector([
(state, { type }) => state.getIn(['settings', type], ImmutableMap()),
(state, { type }) => state.getIn(['timelines', type, 'items'], ImmutableList()),
(state, { type, id }) => state.getIn(['settings', type], ImmutableMap()),
(state, { type, id }) => state.getIn(['timelines', id, 'items'], ImmutableList()),
(state) => state.get('statuses'),
], (columnSettings, statusIds, statuses) => {
return statusIds.filter(id => {
@@ -34,7 +34,7 @@ const mapStateToProps = (state, {timelineId}) => {
const getStatusIds = makeGetStatusIds();
return {
statusIds: getStatusIds(state, { type: timelineId }),
statusIds: getStatusIds(state, { type: timelineId.substring(0,5) === 'group' ? 'group' : timelineId, id: timelineId }),
isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true),
isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false),
hasMore: state.getIn(['timelines', timelineId, 'hasMore']),