Wait for approval tx confirmation when paying for subscription
This commit is contained in:
parent
67cd088ffa
commit
b52a2f947c
1 changed files with 3 additions and 1 deletions
|
@ -66,7 +66,9 @@ export async function makeSubscriptionPayment(
|
|||
subscription.address,
|
||||
)
|
||||
if (allowance.lt(amount)) {
|
||||
await token.approve(subscription.address, amount)
|
||||
const approved = await token.approve(subscription.address, amount)
|
||||
// Wait for confirmation
|
||||
await approved.wait()
|
||||
}
|
||||
const transaction = await subscription.send(
|
||||
recipientAddress,
|
||||
|
|
Loading…
Reference in a new issue