Skip to content

Commit 3db3c10

Browse files
ClearlyClaireGargron
authored andcommitted
Fix filtered out items being counted as pending items (mastodon#12266)
1 parent 65e13cf commit 3db3c10

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

app/javascript/mastodon/features/ui/containers/status_list_container.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { createSelector } from 'reselect';
66
import { debounce } from 'lodash';
77
import { me } from '../../../initial_state';
88

9-
const makeGetStatusIds = () => createSelector([
9+
const makeGetStatusIds = (pending = false) => createSelector([
1010
(state, { type }) => state.getIn(['settings', type], ImmutableMap()),
11-
(state, { type }) => state.getIn(['timelines', type, 'items'], ImmutableList()),
11+
(state, { type }) => state.getIn(['timelines', type, pending ? 'pendingItems' : 'items'], ImmutableList()),
1212
(state) => state.get('statuses'),
1313
], (columnSettings, statusIds, statuses) => {
1414
return statusIds.filter(id => {
@@ -31,13 +31,14 @@ const makeGetStatusIds = () => createSelector([
3131

3232
const makeMapStateToProps = () => {
3333
const getStatusIds = makeGetStatusIds();
34+
const getPendingStatusIds = makeGetStatusIds(true);
3435

3536
const mapStateToProps = (state, { timelineId }) => ({
3637
statusIds: getStatusIds(state, { type: timelineId }),
3738
isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true),
3839
isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false),
3940
hasMore: state.getIn(['timelines', timelineId, 'hasMore']),
40-
numPending: state.getIn(['timelines', timelineId, 'pendingItems'], ImmutableList()).size,
41+
numPending: getPendingStatusIds(state, { type: timelineId }).size,
4142
});
4243

4344
return mapStateToProps;

0 commit comments

Comments
 (0)