From 937edb0cd13f139b44cf2ffe20d7e808777235f3 Mon Sep 17 00:00:00 2001 From: tomiir Date: Thu, 15 Feb 2024 07:33:16 -0600 Subject: [PATCH] fix: buy in progress interval being cleared prematurely (#1925) --- .../scaffold/src/views/w3m-buy-in-progress-view/index.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/scaffold/src/views/w3m-buy-in-progress-view/index.ts b/packages/scaffold/src/views/w3m-buy-in-progress-view/index.ts index 3b395147dc..22455acfdc 100644 --- a/packages/scaffold/src/views/w3m-buy-in-progress-view/index.ts +++ b/packages/scaffold/src/views/w3m-buy-in-progress-view/index.ts @@ -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 } }