From 6bf65d61fc1a246dfc712974af40fd92aabb4d68 Mon Sep 17 00:00:00 2001 From: Michael Scoff Date: Fri, 19 Jan 2018 04:10:50 -0800 Subject: [PATCH] Show transactions view once transaction sent --- Trust/InCoordinator.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Trust/InCoordinator.swift b/Trust/InCoordinator.swift index f32e1fbee..d5142b6e7 100644 --- a/Trust/InCoordinator.swift +++ b/Trust/InCoordinator.swift @@ -22,6 +22,9 @@ class InCoordinator: Coordinator { var transactionCoordinator: TransactionCoordinator? { return self.coordinators.flatMap { $0 as? TransactionCoordinator }.first } + var tabBarController: UITabBarController? { + return self.navigationController.viewControllers.first as? UITabBarController + } lazy var helpUsCoordinator: HelpUsCoordinator = { return HelpUsCoordinator( navigationController: navigationController, @@ -215,7 +218,7 @@ class InCoordinator: Coordinator { } private func showTransactionSent(transaction: SentTransaction) { - let alertController = UIAlertController(title: "Transaction Sent!", message: "Wait for the transaction to be mined on the network.", preferredStyle: UIAlertControllerStyle.alert) + let alertController = UIAlertController(title: "Transaction Sent!", message: "Wait for the transaction to be mined on the network to see details.", preferredStyle: UIAlertControllerStyle.alert) let copyAction = UIAlertAction(title: NSLocalizedString("send.action.copy.transaction.title", value: "Copy Transaction ID", comment: ""), style: UIAlertActionStyle.default, handler: { _ in UIPasteboard.general.string = transaction.id }) @@ -267,6 +270,9 @@ extension InCoordinator: PaymentCoordinatorDelegate { coordinator.navigationController.dismiss(animated: true, completion: nil) showTransactionSent(transaction: transaction) removeCoordinator(coordinator) + + // Once transaction sent, show transactions screen. + tabBarController?.selectedIndex = 0 } func didCancel(in coordinator: PaymentCoordinator) {