From 4c3307bde7c535c830fa6049c72c1825d51e1d4b Mon Sep 17 00:00:00 2001 From: Nur Fikri Date: Fri, 2 Feb 2024 11:23:10 +0700 Subject: [PATCH] fix: tx hash not showing in multiple transaction --- src/components/RouteDisplay.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/RouteDisplay.tsx b/src/components/RouteDisplay.tsx index 01b48dc0..edb9623a 100644 --- a/src/components/RouteDisplay.tsx +++ b/src/components/RouteDisplay.tsx @@ -109,6 +109,7 @@ function TransferStep({ action, actions, id, statusData }: TransferStepProps) { // We can assume that the swap operation by the previous transfer .find((x) => Number(x.id.split("-")[2]) === operationIndex + 1) ?.id.split("-")[0] === "swap"; + const isPrevOpTransfer = actions[operationIndex - 1]?.type === "TRANSFER"; // We can assume that the transfer is successful when the state is TRANSFER_SUCCESS or TRANSFER_RECEIVED const renderTransferState = useMemo(() => { @@ -165,13 +166,14 @@ function TransferStep({ action, actions, id, statusData }: TransferStepProps) { const packetTx = (() => { if (operationIndex === 0) return transferStatus?.txs.sendTx; if (isNextOpSwap) return transferStatus?.txs.sendTx; + if (isPrevOpTransfer) return transferStatus?.txs.sendTx; return transferStatus?.txs.receiveTx; })(); if (!packetTx?.explorerLink) { return null; } return makeExplorerLink(packetTx.explorerLink); - }, [isNextOpSwap, operationIndex, transferStatus?.txs.receiveTx, transferStatus?.txs.sendTx]); + }, [isNextOpSwap, isPrevOpTransfer, operationIndex, transferStatus?.txs.receiveTx, transferStatus?.txs.sendTx]); const { getAsset } = useAssets();