Skip to content

Commit

Permalink
fix: show transaction title for batch all with unknown tx (#2906)
Browse files Browse the repository at this point in the history
  • Loading branch information
Asmadek authored Dec 26, 2024
1 parent 426e833 commit 3c4da74
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/renderer/entities/transaction/lib/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ export const findCoreBatchAll = (coreTx: Transaction | DecodedTransaction): Tran
return coreTx.args?.transactions?.find((t: Transaction) => t.type === TransactionType.UNLOCK) || coreTx;
}

return coreTx.args?.transactions?.find((tx: Transaction) => isWrappedInBatchAll(tx.type));
const supportedTransaction = coreTx.args?.transactions?.find((tx: Transaction) => isWrappedInBatchAll(tx.type));

return supportedTransaction || coreTx.args?.transactions?.[0];
};

export const getTransactionAmount = (tx: Transaction | DecodedTransaction): string | null => {
Expand Down Expand Up @@ -348,7 +350,9 @@ export const getModalTransactionTitle = (
}

if (transaction.type === TransactionType.BATCH_ALL) {
return getModalTransactionTitle(crossChain, t, transaction.args?.transactions?.[0]);
const txMatch = findCoreBatchAll(transaction);

return getModalTransactionTitle(crossChain, t, txMatch);
}

if (transaction.type === TransactionType.PROXY) {
Expand Down

0 comments on commit 3c4da74

Please sign in to comment.