Skip to content

Commit

Permalink
[C-2306] Fix sign-in sign-up invalid email bug (#3186)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjeffers committed Apr 6, 2023
1 parent 29117e7 commit 599e9f5
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions apps/audius-client/packages/mobile/src/screens/signon/SignOn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,7 @@ const SignOn = ({ navigation }: SignOnProps) => {
}
if (!isSignin && !emailIsAvailable && email !== '') {
return (
<TouchableOpacity
style={styles.errorButton}
onPress={() => {
switchForm(true)
}}
>
<TouchableOpacity style={styles.errorButton} onPress={switchForm}>
<Animated.View
style={[styles.errorContainer, { opacity: errorOpacity }]}
>
Expand Down Expand Up @@ -537,7 +532,7 @@ const SignOn = ({ navigation }: SignOnProps) => {
)
}

const switchForm = (keepEmail = false) => {
const switchForm = () => {
if (!isWorking) {
if (isSignin) {
setFormButtonMarginTop(28)
Expand All @@ -557,10 +552,6 @@ const SignOn = ({ navigation }: SignOnProps) => {
)
}

if (!keepEmail) {
setEmail('')
}

setShowInvalidEmailError(false)
setAttemptedEmail(false)
setShowEmptyPasswordError(false)
Expand Down Expand Up @@ -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)
},
() => {
Expand Down Expand Up @@ -795,9 +786,7 @@ const SignOn = ({ navigation }: SignOnProps) => {
<TouchableOpacity
style={styles.switchFormBtn}
activeOpacity={0.6}
onPress={() => {
switchForm()
}}
onPress={switchForm}
>
{renderFormSwitchButton()}
</TouchableOpacity>
Expand Down

0 comments on commit 599e9f5

Please sign in to comment.