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 {
112
112
// activeBucket,
113
113
auth,
114
114
// dropChallenges,
115
+ communityId,
116
+ communitiesList,
115
117
getCommunitiesList,
116
118
// allActiveChallengesLoaded,
117
119
// getRestActiveChallenges,
@@ -134,6 +136,7 @@ export class ListingContainer extends React.Component {
134
136
getPastChallenges,
135
137
filterState,
136
138
loading,
139
+ setFilter,
137
140
} = this . props ;
138
141
const oldUserId = _ . get ( prevProps , 'auth.user.userId' ) ;
139
142
const userId = _ . get ( this . props , 'auth.user.userId' ) ;
@@ -177,6 +180,23 @@ export class ListingContainer extends React.Component {
177
180
bucket = 'openForRegistration' ;
178
181
}
179
182
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
+
180
200
if ( bucket ) {
181
201
switch ( bucket ) {
182
202
case BUCKETS . MY : {
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ export default function ChallengeListingRoute({
31
31
32
32
let { communityId } = query ;
33
33
if ( ! communityId
34
- && ! _ . get ( meta , 'challengeListing.ignoreCommunityFilterByDefault' ) ) {
34
+ && ( ! _ . get ( meta , 'challengeListing.ignoreCommunityFilterByDefault' )
35
+ || meta . communityId === 'wipro' ) ) {
35
36
( { communityId } = meta ) ;
36
37
}
37
38
You can’t perform that action at this time.
0 commit comments