Don't start with import window

This commit is contained in:
Ivan Grachev 2021-07-20 23:19:35 +03:00
parent 2ab0bf27a4
commit 6a342016b1
2 changed files with 3 additions and 16 deletions

View File

@ -51,16 +51,9 @@ class Agent: NSObject {
let windowController = Window.showNew()
let completion = onSelectedAccount(session: wcSession)
let accounts = accountsService.getAccounts()
if !accounts.isEmpty {
let accountsList = AccountsListViewController.with(preloadedAccounts: accounts)
accountsList.onSelectedAccount = completion
windowController.contentViewController = accountsList
} else {
let importViewController = instantiate(ImportViewController.self)
importViewController.onSelectedAccount = completion
windowController.contentViewController = importViewController
}
let accountsList = instantiate(AccountsListViewController.self)
accountsList.onSelectedAccount = completion
windowController.contentViewController = accountsList
}
func showApprove(transaction: Transaction, peerMeta: WCPeerMeta?, completion: @escaping (Transaction?) -> Void) {

View File

@ -10,12 +10,6 @@ class AccountsListViewController: NSViewController {
var onSelectedAccount: ((Account) -> Void)?
static func with(preloadedAccounts: [Account]) -> AccountsListViewController {
let new = instantiate(AccountsListViewController.self)
new.accounts = preloadedAccounts
return new
}
@IBOutlet weak var addButton: NSButton! {
didSet {
let menu = NSMenu()