Skip to content

Commit

Permalink
[C-2059] Show toast when email check fails due to blocked user (#3166)
Browse files Browse the repository at this point in the history
  • Loading branch information
sliptype committed Apr 4, 2023
1 parent d84dc20 commit b24fe62
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions apps/audius-client/packages/mobile/src/screens/signon/SignOn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import Button from 'app/components/button'
import LoadingSpinner from 'app/components/loading-spinner'
import { remindUserToTurnOnNotifications } from 'app/components/notification-reminder/NotificationReminder'
import useAppState from 'app/hooks/useAppState'
import { useToast } from 'app/hooks/useToast'
import { screen, track, make } from 'app/services/analytics'
import { setVisibility } from 'app/store/drawers/slice'
import { EventNames } from 'app/types/analytics'
Expand Down Expand Up @@ -257,7 +258,8 @@ const messages = {
newToAudius: 'New to Audius?',
createAccount: 'Create an Account',
hasAccountAlready: 'Already have an account?',
forgotPassword: 'Forgot your password?'
forgotPassword: 'Forgot your password?',
error: 'Something went wrong, please try again later'
}

const errorMessages = {
Expand Down Expand Up @@ -610,6 +612,8 @@ const SignOn = ({ navigation }: SignOnProps) => {
}) => {
let opacity = new Animated.Value(1)

const { toast } = useToast()

// fade the sign up/in button out and in when switch between signup and signin
if (lastIsSignin !== isSignin) {
opacity = new Animated.Value(0)
Expand Down Expand Up @@ -657,7 +661,9 @@ const SignOn = ({ navigation }: SignOnProps) => {
setIsWorking(false)
},
() => {
// On any unknown error, do nothing, but let the user try again
// On any unknown error, toast and let the user try again
// This could be due to the user being blocked by CloudFlare
toast({ content: messages.error })
setIsWorking(false)
}
)
Expand Down

0 comments on commit b24fe62

Please sign in to comment.