Suggest adding an account on macOS when there are no matching

This commit is contained in:
Ivan Grachev 2022-08-25 22:12:48 +03:00
parent 94a6ead102
commit 49fc3745a6

View File

@ -10,6 +10,7 @@ class AccountsListViewController: NSViewController {
private var cellModels = [CellModel]() private var cellModels = [CellModel]()
private var network = EthereumChain.ethereum private var network = EthereumChain.ethereum
private var didCallCompletion = false private var didCallCompletion = false
private var didAppear = false
var selectAccountAction: SelectAccountAction? var selectAccountAction: SelectAccountAction?
var newWalletId: String? var newWalletId: String?
var getBackToRect: CGRect? var getBackToRect: CGRect?
@ -95,6 +96,13 @@ class AccountsListViewController: NSViewController {
blinkNewWalletCellIfNeeded() blinkNewWalletCellIfNeeded()
view.window?.delegate = self view.window?.delegate = self
promptSafariForLegacyUsersIfNeeded() promptSafariForLegacyUsersIfNeeded()
if !didAppear {
didAppear = true
if let coin = selectAccountAction?.coinType, walletsManager.suggestedAccounts(coin: coin).isEmpty, !wallets.isEmpty {
Alert.showWithMessage(String(format: Strings.addAccountToConnect, arguments: [coin.name]), style: .informational)
}
}
} }
private func promptSafariForLegacyUsersIfNeeded() { private func promptSafariForLegacyUsersIfNeeded() {