Преглед изворни кода

fix disappearing email and password strings during account setup if the user opens an advanced sub setting

cyberta пре 5 година
родитељ
комит
1910c6271b
1 измењених фајлова са 4 додато и 8 уклоњено
  1. 4 8
      deltachat-ios/Controller/AccountSetupController.swift

+ 4 - 8
deltachat-ios/Controller/AccountSetupController.swift

@@ -349,14 +349,14 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
             title = String.localized("login_header")
         }
         navigationItem.rightBarButtonItem = loginButton
+        emailCell.setText(text: dcContext.addr ?? nil)
+        passwordCell.setText(text: dcContext.mailPw ?? nil)
     }
 
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         initSelectionCells()
-        updateCellData()
         handleLoginButton()
-
     }
 
     override func viewDidAppear(_ animated: Bool) {
@@ -487,12 +487,6 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
         }
     }
 
-    // MARK: - updates
-    private func updateCellData() {
-        emailCell.setText(text: dcContext.addr ?? nil)
-        passwordCell.setText(text: dcContext.mailPw ?? nil)
-    }
-
     // MARK: - actions
     private func toggleAdvancedSection() {
         let willShow = !advancedSectionShowing
@@ -666,6 +660,8 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
                 } else if ui["done"] as! Bool {
                     self.dcContext.maybeStartIo()
                     self.updateProgressAlertSuccess(completion: self.handleLoginSuccess)
+                    self.emailCell.setText(text: nil)
+                    self.passwordCell.setText(text: nil)
                 } else {
                     self.updateProgressAlertValue(value: ui["progress"] as? Int)
                 }