Skip to content

Commit

Permalink
fix: buy in progress interval being cleared prematurely (#1925)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomiir authored Feb 15, 2024
1 parent 334ad12 commit 937edb0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/scaffold/src/views/w3m-buy-in-progress-view/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,11 @@ export class W3mBuyInProgressView extends LitElement {
tx => tx.metadata.status === 'ONRAMP_TRANSACTION_STATUS_IN_PROGRESS'
)

if (this.intervalId) {
if (pendingTransactions.length && this.intervalId) {
clearInterval(this.intervalId)
}

if (pendingTransactions.length) {
RouterController.replace('OnRampActivity')
} else if (this.startTime && Date.now() - this.startTime >= 180_000) {
} else if (this.startTime && Date.now() - this.startTime >= 180_000 && this.intervalId) {
clearInterval(this.intervalId)
this.error = true
}
}
Expand Down

0 comments on commit 937edb0

Please sign in to comment.