Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
[C-1107] Fix push to sign in when identity is down (#1931)
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondjacobson committed Sep 15, 2022
1 parent 43222ee commit 54dcd64
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2240,7 +2240,7 @@ export const audiusBackend = ({
return emailExists
} catch (error) {
console.error(getErrorMessage(error))
return true
throw error
}
}

Expand Down
7 changes: 7 additions & 0 deletions packages/mobile/src/screens/signon/SignOn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -641,12 +641,19 @@ const SignOn = ({ navigation }: SignOnProps) => {
signOnActions.checkEmail(
email,
() => {
// On available email, move to create password
navigation.replace('CreatePassword')
setIsWorking(false)
},
() => {
// On unavailable email (e.g. user exists with that email),
// Switch to the sign in form
switchForm()
setIsWorking(false)
},
() => {
// On any unknown error, do nothing, but let the user try again
setIsWorking(false)
}
)
)
Expand Down
5 changes: 3 additions & 2 deletions packages/web/src/common/store/pages/signon/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ export function resetSignOn() {
export function checkEmail(
email: string,
onAvailable?: () => void,
onUnavailable?: () => void
onUnavailable?: () => void,
onError?: () => void
) {
return { type: CHECK_EMAIL, email, onAvailable, onUnavailable }
return { type: CHECK_EMAIL, email, onAvailable, onUnavailable, onError }
}

/**
Expand Down
1 change: 1 addition & 0 deletions packages/web/src/common/store/pages/signon/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ function* checkEmail(action) {
}
} catch (err) {
yield put(signOnActions.validateEmailFailed(err.message))
yield call(action.onError)
}
}

Expand Down

0 comments on commit 54dcd64

Please sign in to comment.