diff --git a/src/shared/containers/ProfileStats.jsx b/src/shared/containers/ProfileStats.jsx index cddad713e4..307127c638 100644 --- a/src/shared/containers/ProfileStats.jsx +++ b/src/shared/containers/ProfileStats.jsx @@ -24,11 +24,10 @@ class ProfileStatsContainer extends React.Component { loadStats, loadStatsHistoryAndDistribution, meta, - userId, } = this.props; const trackAndSubTrack = getQueryParamsQuery(location); - loadStats(handleParam, _.join(_.get(meta, 'groupIds', [])), userId); + loadStats(handleParam, _.join(_.get(meta, 'groupIds', []))); if (shouldShowGraph(trackAndSubTrack)) { loadStatsHistoryAndDistribution( handleParam, @@ -50,14 +49,13 @@ class ProfileStatsContainer extends React.Component { const { handleParam, location, - userId, } = this.props; const nextQueryParams = getQueryParamsQuery(nextLocation); const trackAndSubTrack = getQueryParamsQuery(location); if (nextHandleParam !== handleParam) { - loadStats(nextHandleParam, _.join(_.get(meta, 'groupIds', [])), userId); + loadStats(nextHandleParam, _.join(_.get(meta, 'groupIds', []))); if ( nextQueryParams.track !== trackAndSubTrack.track || nextQueryParams.subTrack !== trackAndSubTrack.subTrack @@ -116,7 +114,6 @@ ProfileStatsContainer.propTypes = { loadStats: PT.func.isRequired, loadStatsHistoryAndDistribution: PT.func.isRequired, handleParam: PT.string.isRequired, - userId: PT.number.isRequired, statsHistory: PT.arrayOf(PT.shape()), statsDistribution: PT.shape(), stats: PT.arrayOf(PT.shape()), @@ -129,7 +126,6 @@ ProfileStatsContainer.propTypes = { const mapStateToProps = (state, ownProps) => { const handleParam = ownProps.match.params.handle; const obj = _.get(state.members, handleParam, {}); - const userId = _.get(state.profile.info, 'userId'); return ({ handleParam, loadingError: state.members.loadingError, @@ -144,7 +140,6 @@ const mapStateToProps = (state, ownProps) => { info: state.profile.info, meta: ownProps.meta, achievements: state.profile.achievements, - userId, }); }; @@ -153,13 +148,13 @@ function mapDispatchToProps(dispatch) { const pa = actions.profile; return { - loadStats: (handle, groupIds, userId) => { + loadStats: (handle, groupIds) => { dispatch(a.getStatsInit(handle)); dispatch(a.getStatsDone(handle, groupIds)); dispatch(pa.getInfoInit(handle)); dispatch(pa.getInfoDone(handle)); - dispatch(a.getActiveChallengesInit(userId)); - dispatch(a.getActiveChallengesDone(userId)); + dispatch(a.getActiveChallengesInit(handle)); + dispatch(a.getActiveChallengesDone(handle)); }, loadStatsHistoryAndDistribution: (handle, groupIds, track, subTrack) => { dispatch(a.getStatsHistoryInit(handle));