Skip to content
This repository has been archived by the owner on Jun 2, 2019. It is now read-only.

Commit

Permalink
Merge pull request #3 from TrustWallet/clean-inner-navigation-stack
Browse files Browse the repository at this point in the history
Clean navigation stack of the coordinator separately.
  • Loading branch information
OlegGordiichuk authored Aug 8, 2018
2 parents 43e0a44 + cce2fa3 commit 7c111e3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Trust/InCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ class InCoordinator: Coordinator {
}

func restart(for account: WalletInfo) {
cleanNavigationStack()
settingsCoordinator?.rootViewController.navigationItem.leftBarButtonItem = nil
localSchemeCoordinator?.delegate = nil
localSchemeCoordinator = nil
Expand All @@ -254,6 +255,12 @@ class InCoordinator: Coordinator {
deviceChecker.start()
}

private func cleanNavigationStack() {
tokensCoordinator?.navigationController.viewControllers.removeAll()
browserCoordinator?.navigationController.viewControllers.removeAll()
settingsCoordinator?.navigationController.viewControllers.removeAll()
}

func sendFlow(for token: TokenObject) {
guard let tokensCoordinator = tokensCoordinator else { return }
let nav = tokensCoordinator.navigationController
Expand Down

0 comments on commit 7c111e3

Please sign in to comment.