Skip to content

Commit

Permalink
Use finally to update state
Browse files Browse the repository at this point in the history
  • Loading branch information
kkosiorowska committed Oct 31, 2024
1 parent f47c3e9 commit a880198
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dapp/src/hooks/useDepositBTCTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ export function useDepositBTCTransaction(
// @ts-expect-error adjust types to handle bitcoin wallet wrappers
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment
const txhash: string = await client.sendBitcoin(recipient, satoshis)
setInProgress(false)
setTransactionHash(txhash)
} catch (error) {
if (onError) {
onError(error)
}
console.error(error)
} finally {
setInProgress(false)
}
},
Expand Down

0 comments on commit a880198

Please sign in to comment.