Skip to content

Commit 3ffc260

Browse files
committed
fix: user accounts not loading
1 parent 17551fd commit 3ffc260

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/shared/containers/Settings.jsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ function mapStateToProps(state) {
125125
handle: _.get(state.auth, 'user.handle'),
126126
tokenV3: state.auth.tokenV3,
127127
profile: state.auth.profile,
128+
user: state.auth.user,
128129
lookupData: state.lookup,
129130
profileState: state.profile,
130131
loadingError: state.profile.loadingError,
@@ -145,6 +146,7 @@ function mapDispatchToProps(dispatch) {
145146
profile,
146147
tokenV3,
147148
settingsTab,
149+
user,
148150
}) => {
149151
dispatch(profileActions.loadProfile(handle));
150152
if (settingsTab === TABS.PROFILE) {
@@ -157,9 +159,17 @@ function mapDispatchToProps(dispatch) {
157159
// Deprecated. Leaving it here as reminder to update topcoder-react-lib as well
158160
// dispatch(profileActions.getEmailPreferencesDone(profile, tokenV3));
159161
} 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+
}
161167
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+
}
163173
} else if (settingsTab === TABS.TOOLS) {
164174
dispatch(lookupActions.getTypesInit());
165175
dispatch(lookupActions.getTypesDone());

0 commit comments

Comments
 (0)