Skip to content

Commit

Permalink
[Redesign] Add refunded check for Mayan inProgress property
Browse files Browse the repository at this point in the history
Signed-off-by: Emre Bogazliyanlioglu <emre@wormholelabs.xyz>
  • Loading branch information
emreboga committed Sep 23, 2024
1 parent b5ff654 commit 2124b26
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion wormhole-connect/src/hooks/useTransactionHistoryMayan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -106,7 +111,7 @@ const useTransactionHistoryMayan = (
tokenAddress: toTokenAddress,
senderTimestamp: initiatedAt,
explorerLink: `https://explorer.mayan.finance/swap/${sourceTxHash}`,
inProgress: clientStatus?.toLowerCase() !== 'completed',
inProgress,
};

return txData;
Expand Down

0 comments on commit 2124b26

Please sign in to comment.