Skip to content

Commit 7b4357a

Browse files
Merge pull request #386 from pimlicolabs/fix/useWaitForTransactionReceipt
Fix when the receipt.status is pending
2 parents 5edaa2d + 18823bb commit 7b4357a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.changeset/wide-toys-sink.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@permissionless/wagmi": patch
3+
---
4+
5+
Fixed useWaitForTransactionReceipt when the receipt is in pending state

packages/wagmi/hooks/useWaitForTransactionReceipt.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export async function waitForCallsStatus<
211211
try {
212212
// If we already have a valid receipt, let's check if we have enough
213213
// confirmations. If we do, then we can resolve.
214-
if (receipt) {
214+
if (receipt && receipt.status !== "PENDING") {
215215
if (
216216
confirmations > 1 &&
217217
(!receipt.receipts?.[0]?.blockNumber ||
@@ -222,10 +222,6 @@ export async function waitForCallsStatus<
222222
)
223223
return
224224

225-
if (receipt.status === "PENDING") {
226-
return
227-
}
228-
229225
if (receipt.receipts?.length === 0) {
230226
return
231227
}

0 commit comments

Comments
 (0)