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 52d0b08
Showing 1 changed file with 3 additions and 2 deletions.
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 52d0b08

Please sign in to comment.