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 authored Apr 6, 2023
1 parent 2cec764 commit 465182a
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions 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 465182a

Please sign in to comment.