On network switch pass current wallet/account

pull/2/head
Michael Scoff 7 years ago
parent eff5b8cebe
commit 2f82dee7e5
  1. 10
      Trust/InCoordinator.swift
  2. 1
      Trust/Settings/Coordinators/SettingsCoordinator.swift

@ -12,7 +12,7 @@ class InCoordinator: Coordinator {
let navigationController: UINavigationController
var coordinators: [Coordinator] = []
let account: Account
let initialAccount: Account
var keystore: Keystore
var config: Config
weak var delegate: InCoordinatorDelegate?
@ -27,13 +27,13 @@ class InCoordinator: Coordinator {
config: Config = Config()
) {
self.navigationController = navigationController
self.account = account
self.initialAccount = account
self.keystore = keystore
self.config = config
}
func start() {
showTabBar(for: account)
showTabBar(for: initialAccount)
checkDevice()
}
@ -130,7 +130,7 @@ class InCoordinator: Coordinator {
config.isDebugEnabled = !config.isDebugEnabled
guard let transactionCoordinator = transactionCoordinator else { return }
restart(for: account, in: transactionCoordinator)
restart(for: initialAccount, in: transactionCoordinator)
}
func restart(for account: Account, in coordinator: TransactionCoordinator) {
@ -175,7 +175,7 @@ extension InCoordinator: SettingsCoordinatorDelegate {
case .RPCServer:
removeCoordinator(coordinator)
guard let transactionCoordinator = transactionCoordinator else { return }
restart(for: account, in: transactionCoordinator)
restart(for: transactionCoordinator.session.account, in: transactionCoordinator)
case .pushNotifications:
break
case .donate(let address):

@ -23,7 +23,6 @@ class SettingsCoordinator: Coordinator {
return controller
}()
init(
navigationController: UINavigationController = NavigationController(),
keystore: Keystore

Loading…
Cancel
Save