[Glitch] Fix filtered out items being counted as pending items
Port 572d9863ab to glitch-soc
Signed-off-by: Thibaut Girka <thib@sitedethib.com>
			
			
This commit is contained in:
		
							parent
							
								
									be32d811d1
								
							
						
					
					
						commit
						24bbe94224
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		|  | @ -19,9 +19,9 @@ const getRegex = createSelector([ | |||
|   return regex; | ||||
| }); | ||||
| 
 | ||||
| const makeGetStatusIds = () => createSelector([ | ||||
| const makeGetStatusIds = (pending = false) => createSelector([ | ||||
|   (state, { type }) => state.getIn(['settings', type], ImmutableMap()), | ||||
|   (state, { type }) => state.getIn(['timelines', type, 'items'], ImmutableList()), | ||||
|   (state, { type }) => state.getIn(['timelines', type, pending ? 'pendingItems' : 'items'], ImmutableList()), | ||||
|   (state)           => state.get('statuses'), | ||||
|   getRegex, | ||||
| ], (columnSettings, statusIds, statuses, regex) => { | ||||
|  | @ -56,13 +56,14 @@ const makeGetStatusIds = () => createSelector([ | |||
| 
 | ||||
| const makeMapStateToProps = () => { | ||||
|   const getStatusIds = makeGetStatusIds(); | ||||
|   const getPendingStatusIds = makeGetStatusIds(true); | ||||
| 
 | ||||
|   const mapStateToProps = (state, { timelineId }) => ({ | ||||
|     statusIds: getStatusIds(state, { type: timelineId }), | ||||
|     isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true), | ||||
|     isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false), | ||||
|     hasMore:   state.getIn(['timelines', timelineId, 'hasMore']), | ||||
|     numPending: state.getIn(['timelines', timelineId, 'pendingItems'], ImmutableList()).size, | ||||
|     numPending: getPendingStatusIds(state, { type: timelineId }).size, | ||||
|   }); | ||||
| 
 | ||||
|   return mapStateToProps; | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue