Selaa lähdekoodia

login progress - show progress alert dialog (adds a strong reference) before adding a weak reference to it

cyberta 5 vuotta sitten
vanhempi
commit
64908f03b1
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 3 3
      deltachat-ios/Handler/ProgressAlertHandler.swift

+ 3 - 3
deltachat-ios/Handler/ProgressAlertHandler.swift

@@ -14,12 +14,12 @@ protocol ProgressAlertHandler: UIViewController {
 extension ProgressAlertHandler {
 
     func showProgressAlert(title: String, dcContext: DcContext) {
-        self.progressAlert = makeProgressAlert(dcContext: dcContext)
-        guard let progressAlert = progressAlert else { return }
+        let progressAlert = makeProgressAlert(dcContext: dcContext)
         progressAlert.actions[0].isEnabled = true
         progressAlert.title = title
         progressAlert.message = String.localized("one_moment")
-        present(progressAlert, animated: true, completion: nil)
+        self.present(progressAlert, animated: true, completion: nil)
+        self.progressAlert = progressAlert
     }
 
     private func makeProgressAlert(dcContext: DcContext) -> UIAlertController {