소스 검색

always pop tab ViewControllers to their root VC after a new account setup

cyberta 5 년 전
부모
커밋
c5e61a009b
2개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      deltachat-ios/Controller/WelcomeViewController.swift
  2. 6 0
      deltachat-ios/Coordinator/AppCoordinator.swift

+ 1 - 0
deltachat-ios/Controller/WelcomeViewController.swift

@@ -21,6 +21,7 @@ class WelcomeViewController: UIViewController, ProgressAlertHandler {
                 [weak self] in
                 if let appDelegate = UIApplication.shared.delegate as? AppDelegate {
                     appDelegate.appCoordinator.presentTabBarController()
+                    appDelegate.appCoordinator.popTabsToRootViewControllers()
                 }
             }
             self.navigationController?.pushViewController(accountSetupController, animated: true)

+ 6 - 0
deltachat-ios/Coordinator/AppCoordinator.swift

@@ -116,4 +116,10 @@ class AppCoordinator {
         showTab(index: chatsTab)
         window.makeKeyAndVisible()
     }
+
+    func popTabsToRootViewControllers() {
+        qrNavController.popToRootViewController(animated: false)
+        chatsNavController.popToRootViewController(animated: false)
+        settingsNavController.popToRootViewController(animated: false)
+    }
 }