Skip to content

Commit ffcab5b

Browse files
authored
Merge pull request #4432 from PrakashDurlabhji/issue_4420
issue 4420 fix
2 parents f10e346 + 3579505 commit ffcab5b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/shared/containers/ProfileStats.jsx

+10-5
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ class ProfileStatsContainer extends React.Component {
2424
loadStats,
2525
loadStatsHistoryAndDistribution,
2626
meta,
27+
userId,
2728
} = this.props;
2829

2930
const trackAndSubTrack = getQueryParamsQuery(location);
30-
loadStats(handleParam, _.join(_.get(meta, 'groupIds', [])));
31+
loadStats(handleParam, _.join(_.get(meta, 'groupIds', [])), userId);
3132
if (shouldShowGraph(trackAndSubTrack)) {
3233
loadStatsHistoryAndDistribution(
3334
handleParam,
@@ -49,13 +50,14 @@ class ProfileStatsContainer extends React.Component {
4950
const {
5051
handleParam,
5152
location,
53+
userId,
5254
} = this.props;
5355

5456
const nextQueryParams = getQueryParamsQuery(nextLocation);
5557
const trackAndSubTrack = getQueryParamsQuery(location);
5658

5759
if (nextHandleParam !== handleParam) {
58-
loadStats(nextHandleParam, _.join(_.get(meta, 'groupIds', [])));
60+
loadStats(nextHandleParam, _.join(_.get(meta, 'groupIds', [])), userId);
5961
if (
6062
nextQueryParams.track !== trackAndSubTrack.track
6163
|| nextQueryParams.subTrack !== trackAndSubTrack.subTrack
@@ -114,6 +116,7 @@ ProfileStatsContainer.propTypes = {
114116
loadStats: PT.func.isRequired,
115117
loadStatsHistoryAndDistribution: PT.func.isRequired,
116118
handleParam: PT.string.isRequired,
119+
userId: PT.number.isRequired,
117120
statsHistory: PT.arrayOf(PT.shape()),
118121
statsDistribution: PT.shape(),
119122
stats: PT.arrayOf(PT.shape()),
@@ -126,6 +129,7 @@ ProfileStatsContainer.propTypes = {
126129
const mapStateToProps = (state, ownProps) => {
127130
const handleParam = ownProps.match.params.handle;
128131
const obj = _.get(state.members, handleParam, {});
132+
const userId = _.get(state.profile.info, 'userId');
129133
return ({
130134
handleParam,
131135
loadingError: state.members.loadingError,
@@ -140,6 +144,7 @@ const mapStateToProps = (state, ownProps) => {
140144
info: state.profile.info,
141145
meta: ownProps.meta,
142146
achievements: state.profile.achievements,
147+
userId,
143148
});
144149
};
145150

@@ -148,13 +153,13 @@ function mapDispatchToProps(dispatch) {
148153
const pa = actions.profile;
149154

150155
return {
151-
loadStats: (handle, groupIds) => {
156+
loadStats: (handle, groupIds, userId) => {
152157
dispatch(a.getStatsInit(handle));
153158
dispatch(a.getStatsDone(handle, groupIds));
154159
dispatch(pa.getInfoInit(handle));
155160
dispatch(pa.getInfoDone(handle));
156-
dispatch(a.getActiveChallengesInit(handle));
157-
dispatch(a.getActiveChallengesDone(handle));
161+
dispatch(a.getActiveChallengesInit(userId));
162+
dispatch(a.getActiveChallengesDone(userId));
158163
},
159164
loadStatsHistoryAndDistribution: (handle, groupIds, track, subTrack) => {
160165
dispatch(a.getStatsHistoryInit(handle));

0 commit comments

Comments
 (0)