From 43450ebc4f923c3b79f11569bb61c1c9300af048 Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 6 Nov 2021 13:42:01 +0100 Subject: [PATCH] Fixed that callback always gets called to that UI can reset its state (e.g. re-enable to Update Transactions Button) --- .../net/dankito/banking/ui/presenter/BankingPresenter.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 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 6af1c262..a6501cf9 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 @@ -392,8 +392,7 @@ open class BankingPresenter( if (accountsToUpdate.isNotEmpty()) { updateAccountsTransactionsAsync(accountsToUpdate, true, callback) - } - else if (allAccounts.isNotEmpty()) { + } else { // so that UI can reset its state callback?.invoke(null) } } @@ -407,8 +406,7 @@ open class BankingPresenter( if (accountsToUpdate.isNotEmpty()) { updateAccountsTransactionsAsync(accountsToUpdate, false, done) - } - else if (allAccounts.isNotEmpty()) { + } else { // so that UI can reset its state done?.invoke(null) } }