소스 검색

fixed bug that welcomescreen was stuck with spinner

nayooti 5 년 전
부모
커밋
7f213431a7
2개의 변경된 파일16개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      deltachat-ios/Controller/AccountSetupController.swift
  2. 15 2
      deltachat-ios/Coordinator/AppCoordinator.swift

+ 1 - 1
deltachat-ios/Controller/AccountSetupController.swift

@@ -825,7 +825,7 @@ class AccountSetupController: UITableViewController {
             appDelegate.open()
             appDelegate.start()
 
-            appDelegate.appCoordinator.presentWelcomeController()
+            appDelegate.appCoordinator.presentWelcomeController(animated: true)
         }))
         alert.addAction(UIAlertAction(title: String.localized("cancel"), style: .cancel))
         present(alert, animated: true, completion: nil)

+ 15 - 2
deltachat-ios/Coordinator/AppCoordinator.swift

@@ -88,7 +88,7 @@ class AppCoordinator: NSObject, Coordinator {
         if dcContext.isConfigured() {
             presentTabBarController()
         } else {
-            presentWelcomeController()
+            showWelomeController()
         }
     }
 
@@ -130,7 +130,19 @@ class AppCoordinator: NSObject, Coordinator {
         }
     }
 
-    func presentWelcomeController() {
+    func presentWelcomeController(animated: Bool) {
+        if animated {
+            welcomeController.setTransitionState(true)
+            showWelomeController()
+            DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
+                self.welcomeController.setTransitionState(false)
+            }
+        } else {
+            showWelomeController()
+        }
+    }
+
+    private func showWelomeController() {
         window.rootViewController = welcomeController
         window.makeKeyAndVisible()
     }
@@ -166,6 +178,7 @@ extension AppCoordinator: WelcomeCoordinator {
         DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
             self.loginController.dismiss(animated: true) {
                 self.presentTabBarController()
+                self.welcomeController.setTransitionState(false)
             }
         }
     }