From 63caf84894972b907452a6cb6dd53a6d343f7f74 Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 20 Sep 2020 15:59:44 +0200 Subject: [PATCH] Fixed setting displayIndex only if adding account was successful --- .../net/dankito/banking/ui/presenter/BankingPresenter.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 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 6d0ab40a..883adc5d 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 @@ -148,10 +148,10 @@ open class BankingPresenter( val startDate = Date() newClient.addAccountAsync { response -> - val account = response.customer - account.displayIndex = customers.size - if (response.successful) { + val account = response.customer + account.displayIndex = customers.size + addClientForAccount(account, newClient) selectedAccount(account)