Skip to content

Commit b2356d6

Browse files
Merge pull request #6687 from topcoder-platform/develop
Release v1.19.1
2 parents 1064dfa + 8dd7c1f commit b2356d6

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/shared/containers/challenge-listing/Listing/index.jsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff 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: {

src/shared/routes/Communities/ChallengeListing.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)