From 4d50b12fa9d3901f1f625c858b50c061906e3d94 Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 14 Sep 2020 23:06:42 +0200 Subject: [PATCH] Fixed that in some cases accountsChangedListeners got called with only one bank as parameter instead of all banks --- .../banking/ui/presenter/BankingPresenter.kt | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) 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 b02c2ea4..979603f5 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 @@ -396,13 +396,13 @@ open class BankingPresenter constructor( open fun accountDisplayIndexUpdated(account: TypedCustomer) { persistAccount(account) - callAccountsChangedListeners(account) + callAccountsChangedListeners() } open fun accountUpdated(bank: TypedCustomer) { persistAccount(bank) - callAccountsChangedListeners(bank) + callAccountsChangedListeners() getBankingClientForAccount(bank)?.dataChanged(bank) } @@ -410,7 +410,7 @@ open class BankingPresenter constructor( open fun accountUpdated(account: TypedBankAccount) { persistAccount(account.customer) - callAccountsChangedListeners(account.customer as TypedCustomer) + callAccountsChangedListeners() } protected open fun persistAccount(customer: ICustomer<*, *>) { @@ -749,14 +749,6 @@ open class BankingPresenter constructor( } } - protected open fun callAccountsChangedListeners(account: TypedCustomer) { - val accounts = ArrayList(listOf(account)) - - ArrayList(accountsChangedListeners).forEach { - it(accounts) // TODO: use RxJava for this - } - } - open fun addRetrievedAccountTransactionsResponseListener(listener: (GetTransactionsResponse) -> Unit): Boolean { return retrievedAccountTransactionsResponseListeners.add(listener)