Fixed adjusting displayIndex when a bank gets deleted

This commit is contained in:
dankito 2020-08-31 11:18:51 +02:00
parent c34d94118f
commit 88df169f92
1 changed files with 9 additions and 0 deletions

View File

@ -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