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 93471c59..386daa9d 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 @@ -254,8 +254,17 @@ open class BankingPresenter( bankingClientsForAccounts.remove(customer) + val displayIndex = customer.displayIndex + persister.deleteAccount(customer, customers) + val sortedBanks = customers.sortedByDisplayIndex() + for (i in IntRange(displayIndex, sortedBanks.size - 1)) { + val bank = sortedBanks[i] + bank.displayIndex = i + accountUpdated(bank) + } + callAccountsChangedListeners() if (wasSelected || areAllAccountSelected) { // to update displayed account transactions as transactions of yet deleted accounts have to be removed