Skip to content

Commit 37e811d

Browse files
fix: updated optional fields check based on updated response (#1055)
1 parent a35a1d1 commit 37e811d

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/common-components/data/reducers.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { THIRD_PARTY_AUTH_CONTEXT, THIRD_PARTY_AUTH_CONTEXT_CLEAR_ERROR_MSG } fr
22
import { COMPLETE_STATE, FAILURE_STATE, PENDING_STATE } from '../../data/constants';
33

44
export const defaultState = {
5-
fieldDescriptions: {},
5+
fieldDescriptions: {
6+
fields: {},
7+
},
68
optionalFields: {
79
fields: {},
810
extended_profile: [],

src/register/RegistrationPage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ const RegistrationPage = (props) => {
296296
optionalFields={optionalFields}
297297
registrationEmbedded={registrationEmbedded}
298298
redirectToProgressiveProfilingPage={
299-
getConfig().ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN && Object.keys(optionalFields).includes('fields')
299+
getConfig().ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN && !!Object.keys(optionalFields.fields).length
300300
}
301301
/>
302302
{autoSubmitRegForm && !errorCode.type ? (

src/register/RegistrationPage.test.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,9 @@ describe('RegistrationPage', () => {
627627
},
628628
commonComponents: {
629629
...initialState.commonComponents,
630-
optionalFields: {},
630+
optionalFields: {
631+
fields: {},
632+
},
631633
},
632634
});
633635
delete window.location;

0 commit comments

Comments
 (0)