File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
containers/challenge-listing/Listing Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,8 @@ export class ListingContainer extends React.Component {
112112 // activeBucket,
113113 auth,
114114 // dropChallenges,
115+ communityId,
116+ communitiesList,
115117 getCommunitiesList,
116118 // allActiveChallengesLoaded,
117119 // getRestActiveChallenges,
@@ -134,6 +136,7 @@ export class ListingContainer extends React.Component {
134136 getPastChallenges,
135137 filterState,
136138 loading,
139+ setFilter,
137140 } = this . props ;
138141 const oldUserId = _ . get ( prevProps , 'auth.user.userId' ) ;
139142 const userId = _ . get ( this . props , 'auth.user.userId' ) ;
@@ -177,6 +180,23 @@ export class ListingContainer extends React.Component {
177180 bucket = 'openForRegistration' ;
178181 }
179182
183+ if ( prevProps . communitiesList . data . length !== communitiesList . data . length ) {
184+ let selectedCommunity ;
185+ if ( communityId ) {
186+ selectedCommunity = communitiesList . data . find ( item => item . communityId === communityId ) ;
187+ }
188+ if ( selectedCommunity ) {
189+ const groups = selectedCommunity . groupIds && selectedCommunity . groupIds . length
190+ ? [ selectedCommunity . groupIds [ 0 ] ] : [ ] ;
191+ // update the challenge listing filter for selected community
192+ setFilter ( {
193+ ..._ . clone ( filter ) ,
194+ groups,
195+ events : [ ] ,
196+ } ) ;
197+ }
198+ }
199+
180200 if ( bucket ) {
181201 switch ( bucket ) {
182202 case BUCKETS . MY : {
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ export default function ChallengeListingRoute({
3131
3232 let { communityId } = query ;
3333 if ( ! communityId
34- && ! _ . get ( meta , 'challengeListing.ignoreCommunityFilterByDefault' ) ) {
34+ && ( ! _ . get ( meta , 'challengeListing.ignoreCommunityFilterByDefault' )
35+ || meta . communityId === 'wipro' ) ) {
3536 ( { communityId } = meta ) ;
3637 }
3738
You can’t perform that action at this time.
0 commit comments