diff --git a/CHANGELOG.md b/CHANGELOG.md index a2184b59..1b4568aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,8 @@ directly impact users rather than highlighting other key architectural updates.* ### Added - Delete Zashi feature has been added. It's accessible from the Advanced settings screen. It removes the wallet - secrets from Zashi and resets its state. + secrets from Zashi and resets its state. +- Transaction messages are now checked and removed in case of duplicity ### Changed - We've improved the visibility logic of the little loader that is part of the Balances widget diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/account/view/HistoryView.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/account/view/HistoryView.kt index b40e6a2f..935a4998 100644 --- a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/account/view/HistoryView.kt +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/account/view/HistoryView.kt @@ -545,8 +545,13 @@ private fun HistoryItemExpandedPart( ) { Column(modifier = modifier) { if (transaction.messages.containsValidMemo()) { + // Filter out identical messages on a multi-messages transaction that could be created, e.g., using + // YWallet, which tends to balance orchard and sapling pools, including by splitting a payment equally + // across both pools. + val uniqueMessages = transaction.messages!!.deduplicateMemos() + HistoryItemMessagePart( - messages = transaction.messages!!.toPersistentList(), + messages = uniqueMessages.toPersistentList(), state = transaction.overview.getExtendedState(), onAction = onAction ) @@ -592,6 +597,10 @@ private fun List?.containsValidMemo(): Boolean { return !isNullOrEmpty() && find { it.isNotEmpty() } != null } +private fun List.deduplicateMemos(): List { + return distinct() +} + const val EXPANDED_TRANSACTION_ID_WIDTH_RATIO = 0.75f const val COLLAPSED_TRANSACTION_ID_WIDTH_RATIO = 0.5f