From f3b7bd952861617e5a179387e73cd00d03cfd533 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 24 Apr 2023 13:54:19 +0530 Subject: [PATCH] update receipts status --- apps/etherscan/src/app/app.tsx | 10 +++------- apps/etherscan/src/app/types/Receipt.ts | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/etherscan/src/app/app.tsx b/apps/etherscan/src/app/app.tsx index 9b5450cb0a..d8cb50d90b 100644 --- a/apps/etherscan/src/app/app.tsx +++ b/apps/etherscan/src/app/app.tsx @@ -85,14 +85,11 @@ const App = () => { } const receiptsNotVerified: Receipt[] = receipts.filter((item: Receipt) => { - return item.status !== "Verified" + return item.status === "Pending in queue" }) if (receiptsNotVerified.length > 0) { const timer1 = setInterval(() => { - for (const item in receiptsNotVerified) { - - } receiptsNotVerified.forEach(async (item) => { if (!clientInstanceRef.current) { return {} @@ -106,19 +103,18 @@ const App = () => { apiKey, getEtherScanApi(network) ) - if (status.result === "Pass - Verified") { + if (status.result === "Pass - Verified" || status.result === "Already Verified") { const newReceipts = receipts.map((currentReceipt: Receipt) => { if (currentReceipt.guid === item.guid) { return { ...currentReceipt, - status: "Verified", + status: status.result, } } return currentReceipt }) clearInterval(timer1) - setReceipts(newReceipts) return () => { diff --git a/apps/etherscan/src/app/types/Receipt.ts b/apps/etherscan/src/app/types/Receipt.ts index 57de417094..0ba32da969 100644 --- a/apps/etherscan/src/app/types/Receipt.ts +++ b/apps/etherscan/src/app/types/Receipt.ts @@ -1,4 +1,4 @@ -export type ReceiptStatus = "Verified" | "Queue" +export type ReceiptStatus = "Pending in queue" | "Pass - Verified" | "Already Verified" export interface Receipt { guid: string