@@ -6,9 +6,9 @@ import { createSelector } from 'reselect';
66import { debounce } from 'lodash' ;
77import { 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
3232const 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