From 2f82dee7e52ecb94cfd0d05fdccec54593d2ee7e Mon Sep 17 00:00:00 2001 From: Michael Scoff Date: Thu, 21 Dec 2017 09:47:13 -0800 Subject: [PATCH] On network switch pass current wallet/account --- Trust/InCoordinator.swift | 10 +++++----- Trust/Settings/Coordinators/SettingsCoordinator.swift | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Trust/InCoordinator.swift b/Trust/InCoordinator.swift index 7c8d0b181..44d821eba 100644 --- a/Trust/InCoordinator.swift +++ b/Trust/InCoordinator.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): diff --git a/Trust/Settings/Coordinators/SettingsCoordinator.swift b/Trust/Settings/Coordinators/SettingsCoordinator.swift index 72769e0d7..015a6201a 100644 --- a/Trust/Settings/Coordinators/SettingsCoordinator.swift +++ b/Trust/Settings/Coordinators/SettingsCoordinator.swift @@ -23,7 +23,6 @@ class SettingsCoordinator: Coordinator { return controller }() - init( navigationController: UINavigationController = NavigationController(), keystore: Keystore