mirror of
https://github.com/lil-org/tokenary.git
synced 2024-12-04 15:26:23 +03:00
Remove account selection on removal
This commit is contained in:
parent
546c41b018
commit
e84b9e0c40
@ -301,9 +301,23 @@ class AccountsListViewController: UIViewController, DataStateContainer {
|
||||
}
|
||||
|
||||
@objc private func walletsChanged() {
|
||||
validateSelectedAccounts()
|
||||
updatePrimaryButton()
|
||||
reloadData()
|
||||
}
|
||||
|
||||
private func validateSelectedAccounts() {
|
||||
guard let specificWalletAccounts = selectAccountAction?.selectedAccounts else { return }
|
||||
for specificWalletAccount in specificWalletAccounts {
|
||||
if let wallet = wallets.first(where: { $0.id == specificWalletAccount.walletId }),
|
||||
wallet.accounts.contains(specificWalletAccount.account) {
|
||||
continue
|
||||
} else {
|
||||
selectAccountAction?.selectedAccounts.remove(specificWalletAccount)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func updateDataState() {
|
||||
let isEmpty = sections.isEmpty
|
||||
dataState = isEmpty ? .noData : .hasData
|
||||
|
Loading…
Reference in New Issue
Block a user