ソースを参照

Merge pull request #678 from deltachat/lint_fixes

fixing lint issues - low hanging fruits
bjoern 5 年 前
コミット
443c422276

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

@@ -190,4 +190,3 @@ class EditSettingsController: UITableViewController, MediaPickerDelegate {
 
 }
 
-

+ 1 - 1
deltachat-ios/Controller/ProfileInfoViewController.swift

@@ -81,7 +81,7 @@ class ProfileInfoViewController: UITableViewController {
     override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? {
         let email = dcContext.addr ?? ""
         let footerTitle = String.localizedStringWithFormat(
-            NSLocalizedString("qraccount_success_enter_name",comment: ""), email
+            NSLocalizedString("qraccount_success_enter_name", comment: ""), email
         )
         return footerTitle
     }

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

@@ -411,7 +411,9 @@ internal final class SettingsViewController: UITableViewController {
             UserDefaults.standard.set(!locationStreaming, forKey: "location_streaming")
         }))
 
-        let logAction = UIAlertAction(title: String.localized("pref_view_log"), style: .default, handler: { [unowned self] _ in self.coordinator?.showDebugToolkit()})
+        let logAction = UIAlertAction(title: String.localized("pref_view_log"), style: .default, handler: { [unowned self] _ in
+            self.coordinator?.showDebugToolkit()
+        })
         alert.addAction(logAction)
         alert.addAction(UIAlertAction(title: String.localized("cancel"), style: .cancel, handler: nil))
         present(alert, animated: true, completion: nil)

+ 1 - 1
deltachat-ios/DC/DcMsg+Extension.swift

@@ -35,7 +35,7 @@ extension DcMsg: MessageType {
             return createAudioMessage(text: text)
         default:
             // TODO: custom views for audio, etc
-            if let _ = self.filename {
+            if self.filename != nil {
                 if Utils.hasAudioSuffix(url: fileURL!) {
                    return createAudioMessage(text: text)
                 }

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

@@ -66,9 +66,9 @@ extension ProgressAlertHandler {
             queue: nil
         ) { notification in
             if let ui = notification.userInfo {
-                if ui["error"] as! Bool {
+                if ui["error"] as? Bool ?? false {
                     self.updateProgressAlert(error: ui["errorMessage"] as? String)
-                } else if ui["done"] as! Bool {
+                } else if ui["done"] as? Bool ?? false {
                     self.updateProgressAlertSuccess(completion: onSuccess)
                 } else {
                     self.updateProgressAlertValue(value: ui["progress"] as? Int)
@@ -77,4 +77,3 @@ extension ProgressAlertHandler {
         }
     }
 }
-