Skip to content

Commit

Permalink
Remove errors on signup update
Browse files Browse the repository at this point in the history
  • Loading branch information
toluo-stripe committed Feb 6, 2025
1 parent 2ab75cc commit 7948f42
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ internal class SignUpViewModel @Inject constructor(
lookupEmail(email)
} else {
updateSignUpState(SignUpState.InputtingRemainingFields)
onError(null)
}
} else {
updateSignUpState(SignUpState.InputtingPrimaryField)
onError(null)
}

if (email != configuration.customerInfo.email) {
Expand Down Expand Up @@ -141,6 +143,7 @@ internal class SignUpViewModel @Inject constructor(
}
LinkAuthResult.NoLinkAccountFound -> {
updateSignUpState(SignUpState.InputtingRemainingFields)
onError(null)
}
is LinkAuthResult.AccountError -> {
updateSignUpState(SignUpState.InputtingPrimaryField)
Expand Down Expand Up @@ -195,11 +198,13 @@ internal class SignUpViewModel @Inject constructor(
}
}

private fun onError(error: Throwable) {
logger.error("SignUpViewModel Error: ", error)
private fun onError(error: Throwable?) {
if (error != null) {
logger.error("SignUpViewModel Error: ", error)
}
updateState {
it.copy(
errorMessage = error.stripeErrorMessage()
errorMessage = error?.stripeErrorMessage()
)
}
}
Expand Down

0 comments on commit 7948f42

Please sign in to comment.