Эх сурвалжийг харах

Merge pull request #139 from deltachat/portFix

add coordinator to initial AccountSetupController
björn petersen 5 жил өмнө
parent
commit
f2d7954743

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

@@ -163,7 +163,6 @@ internal final class SettingsViewController: QuickTableViewController {
 				default:
 					logger.info("unknown title", title)
 				}
-				dc_configure(mailboxPointer)
 				return
 			}
 		}

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

@@ -107,6 +107,9 @@ class AppCoordinator: NSObject, Coordinator {
 	func presentLoginController() {
 		let accountSetupController = AccountSetupController()
 		let accountSetupNav = DCNavigationController(rootViewController: accountSetupController)
+    let coordinator = AccountSetupCoordinator(navigationController: accountSetupNav)
+    childCoordinators.append(coordinator)
+    accountSetupController.coordinator = coordinator
 		rootViewController.present(accountSetupNav, animated: false, completion: nil)
 	}
 }
@@ -125,19 +128,8 @@ extension AppCoordinator: UITabBarControllerDelegate {
 			}
 		}
 	}
-
 }
 
-extension AppCoordinator: UITabBarDelegate {
-	func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
-
-	}
-
-	func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
-		print("shouldSelect")
-		return true
-	}
-}
 
 class ContactListCoordinator: Coordinator {
 	let navigationController: UINavigationController
@@ -272,7 +264,6 @@ class AccountSetupCoordinator: Coordinator {
 		portSettingsController.onDismiss = {
 			port in
 			MRConfig.mailPort = port
-			dc_configure(mailboxPointer)
 		}
 		navigationController.pushViewController(portSettingsController, animated: true)
 	}
@@ -286,7 +277,6 @@ class AccountSetupCoordinator: Coordinator {
 			if let secValue = SecurityValue(rawValue: option) {
 				let value = SecurityConverter.convertValueToInt(type: .IMAPSecurity, value: secValue)
 				MRConfig.setImapSecurity(imapFlags: value)
-				dc_configure(mailboxPointer)
 			}
 		}
 		navigationController.pushViewController(securitySettingsController, animated: true)
@@ -299,7 +289,6 @@ class AccountSetupCoordinator: Coordinator {
 		portSettingsController.onDismiss = {
 			port in
 			MRConfig.sendPort = port
-			dc_configure(mailboxPointer)
 		}
 		navigationController.pushViewController(portSettingsController, animated: true)
 	}
@@ -313,7 +302,6 @@ class AccountSetupCoordinator: Coordinator {
 			if let secValue = SecurityValue(rawValue: option) {
 				let value = SecurityConverter.convertValueToInt(type: .SMTPSecurity, value: secValue)
 				MRConfig.setSmtpSecurity(smptpFlags: value)
-				dc_configure(mailboxPointer)
 			}
 		}
 		navigationController.pushViewController(securitySettingsController, animated: true)