Explorar el Código

avoid flashing up the chatlist between scan and enterName

instead of directly creating the tab-view-controller with enter-name opend
(which led to flashing the chatlist shortly),
create go from the welcome-screen to the enter-name-view-controllen
and when "done" is pressed there, finallly to the tab-view-controller.
B. Petersen hace 5 años
padre
commit
288f75fd2d

+ 4 - 0
deltachat-ios/Controller/ProfileInfoViewController.swift

@@ -131,6 +131,10 @@ class ProfileInfoViewController: UITableViewController {
     @objc private func doneButtonPressed(_ sender: UIBarButtonItem) {
         dcContext.displayname = displayName
         self.dismiss(animated: true, completion: nil)
+
+        if let appDelegate = UIApplication.shared.delegate as? AppDelegate {
+            appDelegate.appCoordinator.presentTabBarController()
+        }
     }
 
     private func galleryButtonPressed(_ action: UIAlertAction) {

+ 1 - 8
deltachat-ios/Coordinator/AppCoordinator.swift

@@ -187,19 +187,12 @@ extension AppCoordinator: WelcomeCoordinator {
     }
 
     func handleQRAccountCreationSuccess() {
-        self.presentTabBarController()
-        showTab(index: 1)
-        presentProfileInfoController()
-    }
-
-    private func presentProfileInfoController() {
         let profileInfoController = ProfileInfoViewController(context: dcContext)
         let profileInfoNav = UINavigationController(rootViewController: profileInfoController)
         profileInfoNav.modalPresentationStyle = .fullScreen
         let coordinator = EditSettingsCoordinator(dcContext: dcContext, navigationController: profileInfoNav)
         profileInfoController.coordinator = coordinator
-        childCoordinators.append(coordinator)
-        tabBarController.present(profileInfoNav, animated: false, completion: nil)
+        welcomeController.present(profileInfoNav, animated: true, completion: nil)
     }
 
     @objc private func cancelButtonPressed(_ sender: UIBarButtonItem) {