Skip to content

Commit

Permalink
Correctly handle challenges during account creation
Browse files Browse the repository at this point in the history
  • Loading branch information
swansontec committed Sep 26, 2024
1 parent ee0ee35 commit f608428
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- fixed: Correctly handle challenge errors during light account creation.

## 3.22.2 (2024-09-26)

- fixed: Spinner showing on pin dots before biometric is read
Expand Down
5 changes: 3 additions & 2 deletions src/hooks/useCreateAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { useImports } from './useImports'
export const useCreateAccountHandler = () => {
const { context, accountOptions } = useImports()
const dispatch = useDispatch()
const challengeId = useSelector(state => state.createChallengeId) ?? undefined
const savedChallengeId =
useSelector(state => state.createChallengeId) ?? undefined

const handleCreateAccount = useHandler(
async (createAccountParams: {
Expand All @@ -20,7 +21,7 @@ export const useCreateAccountHandler = () => {

return await retryOnChallenge({
cancelValue: undefined,
async task() {
async task(challengeId = savedChallengeId) {
const account = await context.createAccount({
...accountOptions,
challengeId,
Expand Down

0 comments on commit f608428

Please sign in to comment.