From 2124b265381cdb0c86f68f8bbe3838e150c689e1 Mon Sep 17 00:00:00 2001 From: Emre Bogazliyanlioglu Date: Thu, 19 Sep 2024 19:45:18 +0300 Subject: [PATCH] [Redesign] Add refunded check for Mayan inProgress property Signed-off-by: Emre Bogazliyanlioglu --- wormhole-connect/src/hooks/useTransactionHistoryMayan.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wormhole-connect/src/hooks/useTransactionHistoryMayan.ts b/wormhole-connect/src/hooks/useTransactionHistoryMayan.ts index fd8faad0d..f751d85a3 100644 --- a/wormhole-connect/src/hooks/useTransactionHistoryMayan.ts +++ b/wormhole-connect/src/hooks/useTransactionHistoryMayan.ts @@ -92,6 +92,11 @@ const useTransactionHistoryMayan = ( return; } + // Transaction is in progress when it's not completed or refunded + const clientStatusLC = clientStatus?.toLowerCase(); + const inProgress = + clientStatusLC !== 'completed' && clientStatusLC !== 'refunded'; + const txData: Transaction = { txHash: sourceTxHash, sender: trader, @@ -106,7 +111,7 @@ const useTransactionHistoryMayan = ( tokenAddress: toTokenAddress, senderTimestamp: initiatedAt, explorerLink: `https://explorer.mayan.finance/swap/${sourceTxHash}`, - inProgress: clientStatus?.toLowerCase() !== 'completed', + inProgress, }; return txData;