Skip to content

Commit

Permalink
PKG -- [fcl-core] Fix fcl.tx(...).onceSealed() not resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed Dec 16, 2024
1 parent cf583cf commit fec83e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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()`
8 changes: 4 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,20 @@ 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)) {
}

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

0 comments on commit fec83e1

Please sign in to comment.