mirror of
https://github.com/lil-org/tokenary.git
synced 2025-01-07 14:10:28 +03:00
Block selecting account of inappropriate coin type
This commit is contained in:
parent
5a16d3aeda
commit
b17d32ec79
@ -485,6 +485,10 @@ class AccountsListViewController: NSViewController {
|
||||
updatePrimaryButton()
|
||||
}
|
||||
|
||||
private func accountCanBeSelected(_ account: Account) -> Bool {
|
||||
return accountSelectionConfiguration?.coinType == nil || accountSelectionConfiguration?.coinType == account.coin
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension AccountsListViewController: TableViewMenuSource {
|
||||
@ -583,9 +587,11 @@ extension AccountsListViewController: NSTableViewDelegate {
|
||||
}
|
||||
|
||||
if accountSelectionConfiguration != nil {
|
||||
let specificWalletAccount = SpecificWalletAccount(walletId: wallet.id, account: account)
|
||||
didClickAccountInSelectionMode(specificWalletAccount: specificWalletAccount)
|
||||
tableView.reloadData()
|
||||
if accountCanBeSelected(account) {
|
||||
let specificWalletAccount = SpecificWalletAccount(walletId: wallet.id, account: account)
|
||||
didClickAccountInSelectionMode(specificWalletAccount: specificWalletAccount)
|
||||
tableView.reloadData()
|
||||
}
|
||||
return false
|
||||
} else {
|
||||
showMenuOnCellSelection(row: row)
|
||||
|
Loading…
Reference in New Issue
Block a user