1
1
/**
2
2
* Connects the Redux store to the Profile display components.
3
3
*/
4
- import _ from 'lodash' ;
5
4
import React from 'react' ;
6
5
import PT from 'prop-types' ;
7
6
import { connect } from 'react-redux' ;
@@ -16,22 +15,20 @@ class ProfileContainer extends React.Component {
16
15
const {
17
16
handleParam,
18
17
loadProfile,
19
- meta,
20
18
} = this . props ;
21
19
22
- loadProfile ( handleParam , _ . join ( _ . get ( meta , 'groupIds' , [ ] ) ) ) ;
20
+ loadProfile ( handleParam ) ;
23
21
}
24
22
25
23
componentWillReceiveProps ( nextProps ) {
26
24
const {
27
25
handleParam,
28
26
profileForHandle,
29
27
loadProfile,
30
- meta,
31
28
} = nextProps ;
32
29
33
30
if ( handleParam !== profileForHandle ) {
34
- loadProfile ( handleParam , _ . join ( _ . get ( meta , 'groupIds' , [ ] ) ) ) ;
31
+ loadProfile ( handleParam ) ;
35
32
}
36
33
}
37
34
@@ -78,7 +75,6 @@ ProfileContainer.defaultProps = {
78
75
profileForHandle : '' ,
79
76
skills : null ,
80
77
stats : null ,
81
- meta : null ,
82
78
} ;
83
79
84
80
ProfileContainer . propTypes = {
@@ -93,9 +89,8 @@ ProfileContainer.propTypes = {
93
89
loadProfile : PT . func . isRequired ,
94
90
profileForHandle : PT . string ,
95
91
skills : PT . shape ( ) ,
96
- stats : PT . arrayOf ( PT . shape ( ) ) ,
92
+ stats : PT . shape ( ) ,
97
93
lookupData : PT . shape ( ) . isRequired ,
98
- meta : PT . shape ( ) ,
99
94
} ;
100
95
101
96
const mapStateToProps = ( state , ownProps ) => ( {
@@ -105,7 +100,6 @@ const mapStateToProps = (state, ownProps) => ({
105
100
externalAccounts : state . profile . externalAccounts ,
106
101
externalLinks : state . profile . externalLinks ,
107
102
handleParam : ownProps . match . params . handle ,
108
- meta : ownProps . meta ,
109
103
info : state . profile . info ,
110
104
loadingError : state . profile . loadingError ,
111
105
profileForHandle : state . profile . profileForHandle ,
@@ -118,7 +112,7 @@ function mapDispatchToProps(dispatch) {
118
112
const a = actions . profile ;
119
113
const lookupActions = actions . lookup ;
120
114
return {
121
- loadProfile : ( handle , groupIds ) => {
115
+ loadProfile : ( handle ) => {
122
116
dispatch ( a . clearProfile ( ) ) ;
123
117
dispatch ( a . loadProfile ( handle ) ) ;
124
118
dispatch ( a . getAchievementsInit ( ) ) ;
@@ -133,7 +127,7 @@ function mapDispatchToProps(dispatch) {
133
127
dispatch ( a . getExternalLinksDone ( handle ) ) ;
134
128
dispatch ( a . getInfoDone ( handle ) ) ;
135
129
dispatch ( a . getSkillsDone ( handle ) ) ;
136
- dispatch ( a . getStatsDone ( handle , groupIds ) ) ;
130
+ dispatch ( a . getStatsDone ( handle ) ) ;
137
131
dispatch ( lookupActions . getCountriesDone ( ) ) ;
138
132
} ,
139
133
} ;
0 commit comments