|
|
@ -68,10 +68,15 @@ class AccountsCoordinator: Coordinator { |
|
|
|
|
|
|
|
|
|
|
|
func importOrCreateWallet(entryPoint: WalletEntryPoint) { |
|
|
|
func importOrCreateWallet(entryPoint: WalletEntryPoint) { |
|
|
|
let coordinator = WalletCoordinator(keystore: keystore) |
|
|
|
let coordinator = WalletCoordinator(keystore: keystore) |
|
|
|
|
|
|
|
if entryPoint == .createInstantWallet { |
|
|
|
|
|
|
|
coordinator.navigationController = navigationController |
|
|
|
|
|
|
|
} |
|
|
|
coordinator.delegate = self |
|
|
|
coordinator.delegate = self |
|
|
|
addCoordinator(coordinator) |
|
|
|
addCoordinator(coordinator) |
|
|
|
coordinator.start(entryPoint) |
|
|
|
let showUI = coordinator.start(entryPoint) |
|
|
|
navigationController.present(coordinator.navigationController, animated: true, completion: nil) |
|
|
|
if showUI { |
|
|
|
|
|
|
|
navigationController.present(coordinator.navigationController, animated: true, completion: nil) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func showCreateWallet() { |
|
|
|
func showCreateWallet() { |
|
|
@ -136,9 +141,14 @@ extension AccountsCoordinator: AccountsViewControllerDelegate { |
|
|
|
extension AccountsCoordinator: WalletCoordinatorDelegate { |
|
|
|
extension AccountsCoordinator: WalletCoordinatorDelegate { |
|
|
|
func didFinish(with account: Wallet, in coordinator: WalletCoordinator) { |
|
|
|
func didFinish(with account: Wallet, in coordinator: WalletCoordinator) { |
|
|
|
delegate?.didAddAccount(account: account, in: self) |
|
|
|
delegate?.didAddAccount(account: account, in: self) |
|
|
|
accountsViewController.fetch() |
|
|
|
if let delegate = delegate { |
|
|
|
coordinator.navigationController.dismiss(animated: true, completion: nil) |
|
|
|
self.removeCoordinator(coordinator) |
|
|
|
removeCoordinator(coordinator) |
|
|
|
self.delegate?.didSelectAccount(account: account, in: self) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
accountsViewController.fetch() |
|
|
|
|
|
|
|
coordinator.navigationController.dismiss(animated: true, completion: nil) |
|
|
|
|
|
|
|
self.removeCoordinator(coordinator) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func didFail(with error: Error, in coordinator: WalletCoordinator) { |
|
|
|
func didFail(with error: Error, in coordinator: WalletCoordinator) { |
|
|
|