Skip to content

Commit

Permalink
🤴 Clear the error message on a new transaction (#1093)
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelpolak2 committed Feb 23, 2023
1 parent 238c82b commit 87b0a02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tame-comics-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@usedapp/core': patch
---

Clear error message on new transaction
2 changes: 1 addition & 1 deletion packages/core/src/hooks/usePromiseTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function usePromiseTransaction(chainId: number | undefined, options?: Tra
const handleNonContractWallet = async (transaction: TransactionResponse) => {
if (!chainId) return

setState((prevState) => ({ ...prevState, transaction, status: 'Mining' }))
setState(({ transactionName }) => ({ transactionName, transaction, status: 'Mining' }))
addTransaction({
transaction: {
...transaction,
Expand Down

2 comments on commit 87b0a02

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.