Skip to content

Commit

Permalink
fix: undefined token2 (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
anukulpandey committed Mar 11, 2024
1 parent 8231f33 commit ed7b59d
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/pages/dashboard/Activity/Activity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,20 @@ const parseTokenTransfers = async(transfers:tokenUtil.TokenTransfer[],nwContext:

const token2 = nftBuyPairs.find((pair:CummulativeTransfers)=>pair.extrinsic.eventIndex==2);

updatedTxArray.push({
isNftBuyOperation: true,
token1: tx,
token2,
fees: feesToken,
timestamp: tx.timestamp,
} as CummulativeTransfers);
if(token2){
updatedTxArray.push({
isNftBuyOperation: true,
token1: tx,
token2,
fees: feesToken,
timestamp: tx.timestamp,
} as CummulativeTransfers);
}else{
updatedTxArray.push({
isSwap: false,
...tx,
} as CummulativeTransfers);
}
}else{
updatedTxArray.push({
isSwap: false,
Expand Down

0 comments on commit ed7b59d

Please sign in to comment.