Skip to content

Commit 8aeacaa

Browse files
fix: fix error banner alert (#1180)
1 parent 80435d3 commit 8aeacaa

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/register/RegistrationPage.jsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,15 @@ const RegistrationPage = (props) => {
144144
);
145145

146146
useEffect(() => {
147-
if (isValidatingSimplifiedRegisterFirstPage && backendValidations
148-
&& Object.values(backendValidations).every(value => value === '')
149-
) {
150-
trackSimplifyRegistrationValidatedSubmitBtnClicked(simplifyRegistrationExpVariation);
151-
trackSimplifyRegistrationSecondStepViewed();
152-
dispatch(setSimplifyRegExperimentData(simplifyRegistrationExpVariation, SECOND_STEP));
147+
if (isValidatingSimplifiedRegisterFirstPage && backendValidations) {
148+
if (Object.values(backendValidations).every(value => value === '')) {
149+
setErrorCode({ type: '', count: 0 });
150+
trackSimplifyRegistrationValidatedSubmitBtnClicked(simplifyRegistrationExpVariation);
151+
trackSimplifyRegistrationSecondStepViewed();
152+
dispatch(setSimplifyRegExperimentData(simplifyRegistrationExpVariation, SECOND_STEP));
153+
} else {
154+
setErrorCode(prevState => ({ type: FORM_SUBMISSION_ERROR, count: prevState.count + 1 }));
155+
}
153156
}
154157
}, [ // eslint-disable-line react-hooks/exhaustive-deps
155158
isValidatingSimplifiedRegisterFirstPage,

0 commit comments

Comments
 (0)