Fixed adjusting displayIndex when a bank gets deleted
This commit is contained in:
parent
c34d94118f
commit
88df169f92
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue