From 1f320888c6721bd7b065b5fad4973c7bba157cf8 Mon Sep 17 00:00:00 2001 From: Alice Di Rico <83651704+Ladirico@users.noreply.github.com> Date: Wed, 24 Jan 2024 12:41:29 +0100 Subject: [PATCH] add comments --- ts/screens/profile/CduEmailInsertScreen.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ts/screens/profile/CduEmailInsertScreen.tsx b/ts/screens/profile/CduEmailInsertScreen.tsx index a048a2eafdb..44b9f9beb92 100644 --- a/ts/screens/profile/CduEmailInsertScreen.tsx +++ b/ts/screens/profile/CduEmailInsertScreen.tsx @@ -212,6 +212,15 @@ const CduEmailInsertScreen = (props: Props) => { }; const handleOnChangeEmailText = (value: string) => { + /** + * SCENARIOS: + * 1. first onboarding and email already taken => if the CIT write + * the same email as the one he has to modify, he is blocked + * 2. first onboarding and NOT email already taken => the email + * with which he/she is logged in is valid and the CIT is not blocked + * 3. Not first onboarding => if the CIT write the same email as the one + * he already send, he is blocked. + */ if (isFirstOnBoarding) { setAreSameEmails( isProfileEmailAlreadyTaken @@ -378,6 +387,8 @@ const CduEmailInsertScreen = (props: Props) => { } inputProps={{ returnKeyType: "done", + // continueOnPress is called by pressing the + // button on the keyboard only if the mail is valid onSubmitEditing: isButtonDisabled ? undefined : continueOnPress,