@@ -125,6 +125,7 @@ function mapStateToProps(state) {
125
125
handle : _ . get ( state . auth , 'user.handle' ) ,
126
126
tokenV3 : state . auth . tokenV3 ,
127
127
profile : state . auth . profile ,
128
+ user : state . auth . user ,
128
129
lookupData : state . lookup ,
129
130
profileState : state . profile ,
130
131
loadingError : state . profile . loadingError ,
@@ -145,6 +146,7 @@ function mapDispatchToProps(dispatch) {
145
146
profile,
146
147
tokenV3,
147
148
settingsTab,
149
+ user,
148
150
} ) => {
149
151
dispatch ( profileActions . loadProfile ( handle ) ) ;
150
152
if ( settingsTab === TABS . PROFILE ) {
@@ -157,9 +159,17 @@ function mapDispatchToProps(dispatch) {
157
159
// Deprecated. Leaving it here as reminder to update topcoder-react-lib as well
158
160
// dispatch(profileActions.getEmailPreferencesDone(profile, tokenV3));
159
161
} else if ( settingsTab === TABS . ACCOUNT ) {
160
- dispatch ( profileActions . getLinkedAccountsDone ( profile , tokenV3 ) ) ;
162
+ if ( profile . userId ) {
163
+ dispatch ( profileActions . getLinkedAccountsDone ( profile , tokenV3 ) ) ;
164
+ } else if ( user . userId ) {
165
+ dispatch ( profileActions . getLinkedAccountsDone ( user , tokenV3 ) ) ;
166
+ }
161
167
dispatch ( profileActions . getExternalLinksDone ( handle ) ) ;
162
- dispatch ( profileActions . getCredentialDone ( profile , tokenV3 ) ) ;
168
+ if ( profile . userId ) {
169
+ dispatch ( profileActions . getCredentialDone ( profile , tokenV3 ) ) ;
170
+ } else if ( user . userId ) {
171
+ dispatch ( profileActions . getCredentialDone ( user , tokenV3 ) ) ;
172
+ }
163
173
} else if ( settingsTab === TABS . TOOLS ) {
164
174
dispatch ( lookupActions . getTypesInit ( ) ) ;
165
175
dispatch ( lookupActions . getTypesDone ( ) ) ;
0 commit comments