From c4e1edef19e7d946dfd2873cd3e7608a187770d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Regadas?= Date: Wed, 3 May 2023 16:00:38 +0100 Subject: [PATCH] [MMI] Don't group transactions by nonce if they are custodial Tx (#18982) * adds mmi fence * adds comment and casts variable to bool * prettier --- ui/selectors/transactions.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ui/selectors/transactions.js b/ui/selectors/transactions.js index b104e8572..63e72d8c2 100644 --- a/ui/selectors/transactions.js +++ b/ui/selectors/transactions.js @@ -251,7 +251,18 @@ export const nonceSortedTransactionsSelector = createSelector( txReceipt, } = transaction; - if (typeof nonce === 'undefined' || type === TransactionType.incoming) { + // Don't group transactions by nonce if: + // 1. Tx nonce is undefined + // 2. Tx is incoming (deposit) + // 3. Tx is custodial (mmi specific) + let shouldNotBeGrouped = + typeof nonce === 'undefined' || type === TransactionType.incoming; + + ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) + shouldNotBeGrouped = shouldNotBeGrouped || Boolean(transaction.custodyId); + ///: END:ONLY_INCLUDE_IN + + if (shouldNotBeGrouped) { const transactionGroup = { transactions: [transaction], initialTransaction: transaction,