浏览代码

show error message in a separte alert with correct button labels

B. Petersen 5 年之前
父节点
当前提交
3a3174a69f
共有 2 个文件被更改,包括 6 次插入4 次删除
  1. 6 3
      deltachat-ios/Controller/AccountSetupController.swift
  2. 0 1
      deltachat-ios/en.lproj/Localizable.strings

+ 6 - 3
deltachat-ios/Controller/AccountSetupController.swift

@@ -54,9 +54,12 @@ class AccountSetupController: UITableViewController {
     }
 
     private func updateProgressHud(error message: String?) {
-        configProgressAlert.title = String.localized("login_error_title")
-        configProgressAlert.message = message
-        configProgressIndicator.alpha = 0
+        DispatchQueue.main.async(execute: {
+            self.configProgressAlert.dismiss(animated: false)
+            let errorAlert = UIAlertController(title: String.localized("error"), message: message, preferredStyle: .alert)
+            errorAlert.addAction(UIAlertAction(title: String.localized("ok"), style: .default, handler: nil))
+            self.present(errorAlert, animated: true, completion: nil)
+        })
     }
 
     private func updateProgressHudSuccess() {

+ 0 - 1
deltachat-ios/en.lproj/Localizable.strings

@@ -604,7 +604,6 @@
 "a11y_background_preview_label" = "Background preview";
 
 "hide" = "Hide";
-"login_error_title" = "Unable to login!";
 "start_chat" = "Start Chat";
 "dismiss" = "Dismiss";
 "photo" = "Photo";