diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt index 955af9e9..41fc4133 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt @@ -794,14 +794,14 @@ open class BankingPresenter( open fun searchAccountTransactions(query: String, transactions: List): List { val queryLowercase = query.trim().toLowerCase() - // get transactions sorted by date - val transactionsSorted = transactions.toSet().sortedByDate() + // get unique transactions sorted by date + val uniqueTransactionsSorted = transactions.toSet().sortedByDate() if (queryLowercase.isEmpty()) { - return transactionsSorted + return uniqueTransactionsSorted } - return transactionsSorted.filter { + return uniqueTransactionsSorted.filter { it.otherPartyName?.toLowerCase()?.contains(queryLowercase) == true || it.reference.toLowerCase().contains(queryLowercase) || it.bookingText?.toLowerCase()?.contains(queryLowercase) == true