Skip to content

Commit 6d28f36

Browse files
authored
Merge pull request #4514 from topcoder-platform/issue_4383
fix for issue #4383
2 parents f2ee417 + 4b59397 commit 6d28f36

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/shared/containers/ProfileStats.jsx

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

3029
const trackAndSubTrack = getQueryParamsQuery(location);
31-
loadStats(handleParam, _.join(_.get(meta, 'groupIds', [])), userId);
30+
loadStats(handleParam, _.join(_.get(meta, 'groupIds', [])));
3231
if (shouldShowGraph(trackAndSubTrack)) {
3332
loadStatsHistoryAndDistribution(
3433
handleParam,
@@ -50,14 +49,13 @@ class ProfileStatsContainer extends React.Component {
5049
const {
5150
handleParam,
5251
location,
53-
userId,
5452
} = this.props;
5553

5654
const nextQueryParams = getQueryParamsQuery(nextLocation);
5755
const trackAndSubTrack = getQueryParamsQuery(location);
5856

5957
if (nextHandleParam !== handleParam) {
60-
loadStats(nextHandleParam, _.join(_.get(meta, 'groupIds', [])), userId);
58+
loadStats(nextHandleParam, _.join(_.get(meta, 'groupIds', [])));
6159
if (
6260
nextQueryParams.track !== trackAndSubTrack.track
6361
|| nextQueryParams.subTrack !== trackAndSubTrack.subTrack
@@ -116,7 +114,6 @@ ProfileStatsContainer.propTypes = {
116114
loadStats: PT.func.isRequired,
117115
loadStatsHistoryAndDistribution: PT.func.isRequired,
118116
handleParam: PT.string.isRequired,
119-
userId: PT.number.isRequired,
120117
statsHistory: PT.arrayOf(PT.shape()),
121118
statsDistribution: PT.shape(),
122119
stats: PT.arrayOf(PT.shape()),
@@ -129,7 +126,6 @@ ProfileStatsContainer.propTypes = {
129126
const mapStateToProps = (state, ownProps) => {
130127
const handleParam = ownProps.match.params.handle;
131128
const obj = _.get(state.members, handleParam, {});
132-
const userId = _.get(state.profile.info, 'userId');
133129
return ({
134130
handleParam,
135131
loadingError: state.members.loadingError,
@@ -144,7 +140,6 @@ const mapStateToProps = (state, ownProps) => {
144140
info: state.profile.info,
145141
meta: ownProps.meta,
146142
achievements: state.profile.achievements,
147-
userId,
148143
});
149144
};
150145

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

155150
return {
156-
loadStats: (handle, groupIds, userId) => {
151+
loadStats: (handle, groupIds) => {
157152
dispatch(a.getStatsInit(handle));
158153
dispatch(a.getStatsDone(handle, groupIds));
159154
dispatch(pa.getInfoInit(handle));
160155
dispatch(pa.getInfoDone(handle));
161-
dispatch(a.getActiveChallengesInit(userId));
162-
dispatch(a.getActiveChallengesDone(userId));
156+
dispatch(a.getActiveChallengesInit(handle));
157+
dispatch(a.getActiveChallengesDone(handle));
163158
},
164159
loadStatsHistoryAndDistribution: (handle, groupIds, track, subTrack) => {
165160
dispatch(a.getStatsHistoryInit(handle));

0 commit comments

Comments
 (0)