diff --git a/src/common-components/data/reducers.js b/src/common-components/data/reducers.js index a4c99fcf..841ab966 100644 --- a/src/common-components/data/reducers.js +++ b/src/common-components/data/reducers.js @@ -2,7 +2,9 @@ import { THIRD_PARTY_AUTH_CONTEXT, THIRD_PARTY_AUTH_CONTEXT_CLEAR_ERROR_MSG } fr import { COMPLETE_STATE, FAILURE_STATE, PENDING_STATE } from '../../data/constants'; export const defaultState = { - fieldDescriptions: {}, + fieldDescriptions: { + fields: {}, + }, optionalFields: { fields: {}, extended_profile: [], diff --git a/src/register/RegistrationPage.jsx b/src/register/RegistrationPage.jsx index 9ab262bb..896f7551 100644 --- a/src/register/RegistrationPage.jsx +++ b/src/register/RegistrationPage.jsx @@ -296,7 +296,7 @@ const RegistrationPage = (props) => { optionalFields={optionalFields} registrationEmbedded={registrationEmbedded} redirectToProgressiveProfilingPage={ - getConfig().ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN && Object.keys(optionalFields).includes('fields') + getConfig().ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN && !!Object.keys(optionalFields.fields).length } /> {autoSubmitRegForm && !errorCode.type ? ( diff --git a/src/register/RegistrationPage.test.jsx b/src/register/RegistrationPage.test.jsx index 6bf4ac43..5310f162 100644 --- a/src/register/RegistrationPage.test.jsx +++ b/src/register/RegistrationPage.test.jsx @@ -627,7 +627,9 @@ describe('RegistrationPage', () => { }, commonComponents: { ...initialState.commonComponents, - optionalFields: {}, + optionalFields: { + fields: {}, + }, }, }); delete window.location;