@@ -97,10 +97,6 @@ const RegistrationPage = (props) => {
9797 } = props ;
9898
9999 const backendRegistrationError = registrationError ;
100- // useSelector(state => state.register.registrationError);
101-
102- // React query for registration API
103- // new function from hook
104100 const registrationMutation = useRegistration ( {
105101 onSuccess : ( data ) => {
106102 setRegistrationResult ( data ) ;
@@ -112,24 +108,9 @@ const RegistrationPage = (props) => {
112108 } ) ;
113109
114110 const registrationErrorCode = registrationError ?. errorCode || backendRegistrationError ?. errorCode ;
115- // Use context state for registrationResult instead of Redux - removed backup functionality
116- // const userPipelineDataLoaded = useSelector(state => state.register.userPipelineDataLoaded);
117111 const submitState = registrationMutation . isLoading ? PENDING_STATE : DEFAULT_STATE ;
118-
119- // const fieldDescriptions = useSelector(state => state.commonComponents.fieldDescriptions);
120- // const optionalFields = useSelector(state => state.commonComponents.optionalFields);
121- // const thirdPartyAuthApiStatus = useSelector(state => state.commonComponents.thirdPartyAuthApiStatus);
122- // const autoSubmitRegForm = useSelector(state => state.commonComponents.thirdPartyAuthContext.autoSubmitRegForm);
123- // const thirdPartyAuthErrorMessage = useSelector(state => state.commonComponents.thirdPartyAuthContext.errorMessage);
124- // const finishAuthUrl = useSelector(state => state.commonComponents.thirdPartyAuthContext.finishAuthUrl);
125- // const currentProvider = useSelector(state => state.commonComponents.thirdPartyAuthContext.currentProvider);
126- // const providers = useSelector(state => state.commonComponents.thirdPartyAuthContext.providers);
127- // const secondaryProviders = useSelector(state => state.commonComponents.thirdPartyAuthContext.secondaryProviders);
128- // const pipelineUserDetails = useSelector(state => state.commonComponents.thirdPartyAuthContext.pipelineUserDetails);
129-
130112 const queryParams = useMemo ( ( ) => getAllPossibleQueryParams ( ) , [ ] ) ;
131113 const tpaHint = useMemo ( ( ) => getTpaHint ( ) , [ ] ) ;
132-
133114 // Initialize form state from local backedUpFormData
134115 const backedUpFormData = registrationFormData ;
135116 const [ formFields , setFormFields ] = useState ( { ...backedUpFormData . formFields } ) ;
@@ -158,7 +139,6 @@ const RegistrationPage = (props) => {
158139 ...prevState , name, username, email,
159140 } ) ) ;
160141 setUserPipelineDataLoaded ( true ) ;
161- // dispatch(setUserPipelineDataLoaded(true));
162142 }
163143 }
164144 } , [ // eslint-disable-line react-hooks/exhaustive-deps
@@ -227,7 +207,6 @@ const RegistrationPage = (props) => {
227207 const value = event . target . type === 'checkbox' ? event . target . checked : event . target . value ;
228208 if ( backendRegistrationError [ name ] ) {
229209 clearRegistrationBackendError ( name ) ;
230- // dispatch(clearRegistrationBackendError(name));
231210 }
232211 // Clear context registration errors
233212 if ( registrationError . errorCode ) {
@@ -287,7 +266,6 @@ const RegistrationPage = (props) => {
287266 ) ;
288267 setErrors ( { ...fieldErrors } ) ;
289268 setEmailSuggestionContext ( emailSuggestion . suggestion , emailSuggestion . type ) ;
290- // dispatch(setEmailSuggestionInStore(emailSuggestion));
291269
292270 // returning if not valid
293271 if ( ! isValid ) {
0 commit comments