From 599e9f5cfe9b36b640b219f4ab0bc7568412201a Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Thu, 6 Apr 2023 16:14:21 -0700 Subject: [PATCH] [C-2306] Fix sign-in sign-up invalid email bug (#3186) --- .../mobile/src/screens/signon/SignOn.tsx | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/apps/audius-client/packages/mobile/src/screens/signon/SignOn.tsx b/apps/audius-client/packages/mobile/src/screens/signon/SignOn.tsx index 0f76facc226..d5be5fb9e91 100644 --- a/apps/audius-client/packages/mobile/src/screens/signon/SignOn.tsx +++ b/apps/audius-client/packages/mobile/src/screens/signon/SignOn.tsx @@ -466,12 +466,7 @@ const SignOn = ({ navigation }: SignOnProps) => { } if (!isSignin && !emailIsAvailable && email !== '') { return ( - { - switchForm(true) - }} - > + @@ -537,7 +532,7 @@ const SignOn = ({ navigation }: SignOnProps) => { ) } - const switchForm = (keepEmail = false) => { + const switchForm = () => { if (!isWorking) { if (isSignin) { setFormButtonMarginTop(28) @@ -557,10 +552,6 @@ const SignOn = ({ navigation }: SignOnProps) => { ) } - if (!keepEmail) { - setEmail('') - } - setShowInvalidEmailError(false) setAttemptedEmail(false) setShowEmptyPasswordError(false) @@ -657,7 +648,7 @@ const SignOn = ({ navigation }: SignOnProps) => { () => { // On unavailable email (e.g. user exists with that email), // Switch to the sign in form - switchForm(true) + switchForm() setIsWorking(false) }, () => { @@ -795,9 +786,7 @@ const SignOn = ({ navigation }: SignOnProps) => { { - switchForm() - }} + onPress={switchForm} > {renderFormSwitchButton()}