marinofaggiana 4 éve
szülő
commit
11cc97fb8b
1 módosított fájl, 4 hozzáadás és 8 törlés
  1. 4 8
      iOSClient/Utility/NCContentPresenter.swift

+ 4 - 8
iOSClient/Utility/NCContentPresenter.swift

@@ -90,14 +90,10 @@ class NCContentPresenter: NSObject {
             //case Int(kOCErrorServerUnauthorized), Int(kOCErrorServerForbidden):
             //    break
             default:
-                var description = description
-                if description == nil { description = "" }
-                if type == messageType.error {
-                    description = NSLocalizedString("_error_", comment: "") + " " + NSLocalizedString(description!, comment: "")
-                } else {
-                    description = NSLocalizedString(description!, comment: "")
-                }
-                self.flatTop(title: NSLocalizedString(title, comment: ""), description: description!, delay: delay, imageName: nil, type: type, name: "\(errorCode)")
+                guard var description = description else { return }
+                if description.trimmingCharacters(in: .whitespacesAndNewlines) == "" { return }
+                description = NSLocalizedString(description, comment: "")
+                self.flatTop(title: NSLocalizedString(title, comment: ""), description: description, delay: delay, imageName: nil, type: type, name: "\(errorCode)")
             }
         }
     }