Fixed that listeners didn't get removed

This commit is contained in:
dankito 2020-09-28 15:08:44 +02:00
parent 2c9c374ee1
commit b7133ba7d5
1 changed files with 3 additions and 3 deletions

View File

@ -891,7 +891,7 @@ open class BankingPresenter(
} }
open fun removeBanksChangedListener(listener: (List<TypedBankData>) -> Unit): Boolean { open fun removeBanksChangedListener(listener: (List<TypedBankData>) -> Unit): Boolean {
return banksChangedListeners.add(listener) return banksChangedListeners.remove(listener)
} }
protected open fun callBanksChangedListeners() { protected open fun callBanksChangedListeners() {
@ -908,7 +908,7 @@ open class BankingPresenter(
} }
open fun removeRetrievedAccountTransactionsResponseListener(listener: (GetTransactionsResponse) -> Unit): Boolean { open fun removeRetrievedAccountTransactionsResponseListener(listener: (GetTransactionsResponse) -> Unit): Boolean {
return retrievedAccountTransactionsResponseListeners.add(listener) return retrievedAccountTransactionsResponseListeners.remove(listener)
} }
protected open fun callRetrievedAccountTransactionsResponseListener(response: GetTransactionsResponse) { protected open fun callRetrievedAccountTransactionsResponseListener(response: GetTransactionsResponse) {
@ -923,7 +923,7 @@ open class BankingPresenter(
} }
open fun removeSelectedAccountsChangedListener(listener: (List<TypedBankAccount>) -> Unit): Boolean { open fun removeSelectedAccountsChangedListener(listener: (List<TypedBankAccount>) -> Unit): Boolean {
return selectedAccountsChangedListeners.add(listener) return selectedAccountsChangedListeners.remove(listener)
} }
protected open fun callSelectedAccountsChangedListeners(selectedAccounts: List<TypedBankAccount>) { protected open fun callSelectedAccountsChangedListeners(selectedAccounts: List<TypedBankAccount>) {