File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/shared/containers/challenge-listing/Listing Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,10 @@ export class ListingContainer extends React.Component {
50
50
getCommunitiesList,
51
51
markHeaderMenu,
52
52
selectBucket,
53
+ setFilter,
53
54
selectCommunity,
54
55
queryBucket,
56
+ filter,
55
57
} = this . props ;
56
58
57
59
markHeaderMenu ( ) ;
@@ -65,8 +67,10 @@ export class ListingContainer extends React.Component {
65
67
getCommunitiesList ( auth ) ;
66
68
}
67
69
70
+ let selectedCommunity ;
68
71
if ( communityId ) {
69
72
selectCommunity ( communityId ) ;
73
+ selectedCommunity = communitiesList . data . find ( item => item . communityId === communityId ) ;
70
74
}
71
75
72
76
if ( mounted ) {
@@ -76,7 +80,14 @@ export class ListingContainer extends React.Component {
76
80
// if (BUCKETS.PAST !== activeBucket) {
77
81
// dropChallenges();
78
82
// this.loadChallenges();
79
- this . reloadChallenges ( ) ;
83
+ if ( ! selectedCommunity ) {
84
+ this . reloadChallenges ( ) ;
85
+ } else {
86
+ const groups = selectedCommunity . groupIds && selectedCommunity . groupIds . length
87
+ ? [ selectedCommunity . groupIds [ 0 ] ] : [ ] ;
88
+ // update the challenge listing filter for selected community
89
+ setFilter ( { ..._ . clone ( filter ) , groups, events : [ ] } ) ;
90
+ }
80
91
// }
81
92
}
82
93
You can’t perform that action at this time.
0 commit comments