Skip to content

Commit

Permalink
PKG -- [fcl-core] Restore onceSealed() resolution behaviour (#2046)
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink authored Dec 16, 2024
1 parent cf583cf commit c88f170
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-planes-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@onflow/fcl-core": patch
---

Fix bug affecting `fcl.tx(...).onceSealed()`
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions packages/fcl-core/src/transaction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,20 +150,21 @@ export function transaction(
const suppress = opts.suppress || false
return new Promise((resolve, reject) => {
const unsub = subscribe((txStatus, error) => {
if (!suppress) {
if ((error || txStatus.statusCode) && !suppress) {
if (error != null) {
reject(error)
unsub()
return
} else if (txStatus.statusCode === 1) {
const transactionError = TransactionError.fromErrorMessage(
txStatus.errorMessage
)
reject(transactionError)
unsub()
return
}
} else if (predicate(txStatus)) {
return
}

if (predicate(txStatus)) {
resolve(txStatus)
unsub()
}
Expand Down

0 comments on commit c88f170

Please sign in to comment.