Hide network button depending on web3 provider

This commit is contained in:
Ivan Grachev 2022-08-18 14:43:30 +03:00
parent 3412510b38
commit ee3983e1da

View File

@ -144,7 +144,8 @@ class AccountsListViewController: NSViewController {
websiteNameStackView.isHidden = true
}
if canSelectAccount, networkButton.isHidden {
let canSelectNetworkForCurrentProvider = accountSelectionConfiguration?.coinType == .ethereum || accountSelectionConfiguration?.coinType == nil
if canSelectAccount, networkButton.isHidden, canSelectNetworkForCurrentProvider {
networkButton.isHidden = false
let menu = NSMenu()
let titleItem = NSMenuItem(title: Strings.selectNetworkOptionally, action: nil, keyEquivalent: "")
@ -169,7 +170,7 @@ class AccountsListViewController: NSViewController {
menu.addItem(.separator())
menu.addItem(submenuItem)
networkButton.menu = menu
} else if !canSelectAccount, !networkButton.isHidden {
} else if !(canSelectAccount && canSelectNetworkForCurrentProvider), !networkButton.isHidden {
networkButton.isHidden = true
}
}