@@ -24,10 +24,11 @@ class ProfileStatsContainer extends React.Component {
24
24
loadStats,
25
25
loadStatsHistoryAndDistribution,
26
26
meta,
27
+ userId,
27
28
} = this . props ;
28
29
29
30
const trackAndSubTrack = getQueryParamsQuery ( location ) ;
30
- loadStats ( handleParam , _ . join ( _ . get ( meta , 'groupIds' , [ ] ) ) ) ;
31
+ loadStats ( handleParam , _ . join ( _ . get ( meta , 'groupIds' , [ ] ) ) , userId ) ;
31
32
if ( shouldShowGraph ( trackAndSubTrack ) ) {
32
33
loadStatsHistoryAndDistribution (
33
34
handleParam ,
@@ -49,13 +50,14 @@ class ProfileStatsContainer extends React.Component {
49
50
const {
50
51
handleParam,
51
52
location,
53
+ userId,
52
54
} = this . props ;
53
55
54
56
const nextQueryParams = getQueryParamsQuery ( nextLocation ) ;
55
57
const trackAndSubTrack = getQueryParamsQuery ( location ) ;
56
58
57
59
if ( nextHandleParam !== handleParam ) {
58
- loadStats ( nextHandleParam , _ . join ( _ . get ( meta , 'groupIds' , [ ] ) ) ) ;
60
+ loadStats ( nextHandleParam , _ . join ( _ . get ( meta , 'groupIds' , [ ] ) ) , userId ) ;
59
61
if (
60
62
nextQueryParams . track !== trackAndSubTrack . track
61
63
|| nextQueryParams . subTrack !== trackAndSubTrack . subTrack
@@ -114,6 +116,7 @@ ProfileStatsContainer.propTypes = {
114
116
loadStats : PT . func . isRequired ,
115
117
loadStatsHistoryAndDistribution : PT . func . isRequired ,
116
118
handleParam : PT . string . isRequired ,
119
+ userId : PT . number . isRequired ,
117
120
statsHistory : PT . arrayOf ( PT . shape ( ) ) ,
118
121
statsDistribution : PT . shape ( ) ,
119
122
stats : PT . arrayOf ( PT . shape ( ) ) ,
@@ -126,6 +129,7 @@ ProfileStatsContainer.propTypes = {
126
129
const mapStateToProps = ( state , ownProps ) => {
127
130
const handleParam = ownProps . match . params . handle ;
128
131
const obj = _ . get ( state . members , handleParam , { } ) ;
132
+ const userId = _ . get ( state . profile . info , 'userId' ) ;
129
133
return ( {
130
134
handleParam,
131
135
loadingError : state . members . loadingError ,
@@ -140,6 +144,7 @@ const mapStateToProps = (state, ownProps) => {
140
144
info : state . profile . info ,
141
145
meta : ownProps . meta ,
142
146
achievements : state . profile . achievements ,
147
+ userId,
143
148
} ) ;
144
149
} ;
145
150
@@ -148,13 +153,13 @@ function mapDispatchToProps(dispatch) {
148
153
const pa = actions . profile ;
149
154
150
155
return {
151
- loadStats : ( handle , groupIds ) => {
156
+ loadStats : ( handle , groupIds , userId ) => {
152
157
dispatch ( a . getStatsInit ( handle ) ) ;
153
158
dispatch ( a . getStatsDone ( handle , groupIds ) ) ;
154
159
dispatch ( pa . getInfoInit ( handle ) ) ;
155
160
dispatch ( pa . getInfoDone ( handle ) ) ;
156
- dispatch ( a . getActiveChallengesInit ( handle ) ) ;
157
- dispatch ( a . getActiveChallengesDone ( handle ) ) ;
161
+ dispatch ( a . getActiveChallengesInit ( userId ) ) ;
162
+ dispatch ( a . getActiveChallengesDone ( userId ) ) ;
158
163
} ,
159
164
loadStatsHistoryAndDistribution : ( handle , groupIds , track , subTrack ) => {
160
165
dispatch ( a . getStatsHistoryInit ( handle ) ) ;
0 commit comments