marinofaggiana 5 年之前
父節點
當前提交
f7dd2117f5
共有 2 個文件被更改,包括 9 次插入9 次删除
  1. 8 8
      iOSClient/Main/NCDetailViewController.swift
  2. 1 1
      iOSClient/Main/NCMainCommon.swift

+ 8 - 8
iOSClient/Main/NCDetailViewController.swift

@@ -136,16 +136,16 @@ class NCDetailViewController: UIViewController {
     
     @objc func moveFile(_ notification: NSNotification) {
         if let userInfo = notification.userInfo as NSDictionary? {
-            if let metadata = userInfo["metadata"] as? tableMetadata, let metadataNew = userInfo["metadataNew"] as? tableMetadata, let errorCode = userInfo["errorCode"] as? String {
-                if errorCode != "0" { return }
+            if let metadata = userInfo["metadata"] as? tableMetadata, let metadataNew = userInfo["metadataNew"] as? tableMetadata, let errorCode = userInfo["errorCode"] as? Int {
+                if errorCode != 0 { return }
             }
         }
     }
     
     @objc func deleteFile(_ notification: NSNotification) {
         if let userInfo = notification.userInfo as NSDictionary? {
-            if let metadata = userInfo["metadata"] as? tableMetadata, let errorCode = userInfo["errorCode"] as? String {
-                if errorCode != "0" { return }
+            if let metadata = userInfo["metadata"] as? tableMetadata, let errorCode = userInfo["errorCode"] as? Int {
+                if errorCode != 0 { return }
                 
                 // IMAGE
                 if mediaBrowser != nil && metadata.account == self.metadata?.account && metadata.serverUrl == self.metadata?.serverUrl && metadata.typeFile == k_metadataTypeFile_image {
@@ -182,8 +182,8 @@ class NCDetailViewController: UIViewController {
     
     @objc func uploadFile(_ notification: NSNotification) {
         if let userInfo = notification.userInfo as NSDictionary? {
-            if let metadata = userInfo["metadata"] as? tableMetadata, let errorCode = userInfo["errorCode"] as? String {
-                if errorCode != "0" { return }
+            if let metadata = userInfo["metadata"] as? tableMetadata, let errorCode = userInfo["errorCode"] as? Int {
+                if errorCode != 0 { return }
                 
                 // IMAGE
                 if mediaBrowser != nil && metadata.account == self.metadata?.account && metadata.serverUrl == self.metadata?.serverUrl && metadata.typeFile == k_metadataTypeFile_image {
@@ -199,8 +199,8 @@ class NCDetailViewController: UIViewController {
     
     @objc func renameFile(_ notification: NSNotification) {
         if let userInfo = notification.userInfo as NSDictionary? {
-            if let metadata = userInfo["metadata"] as? tableMetadata, let errorCode = userInfo["errorCode"] as? String {
-                if errorCode != "0" { return }
+            if let metadata = userInfo["metadata"] as? tableMetadata, let errorCode = userInfo["errorCode"] as? Int {
+                if errorCode != 0 { return }
                 
                 // IMAGE
                 if mediaBrowser != nil && metadata.account == self.metadata?.account && metadata.serverUrl == self.metadata?.serverUrl && metadata.typeFile == k_metadataTypeFile_image {

+ 1 - 1
iOSClient/Main/NCMainCommon.swift

@@ -1020,7 +1020,7 @@ class NCMainCommon: NSObject, PhotoEditorDelegate, NCAudioRecorderViewController
                     }
                     
                     // Message
-                    let userInfo: [String : Any] = ["metadata": metadata, "errorCode": String(errorCode)]
+                    let userInfo: [String : Any] = ["metadata": metadata, "errorCode": Int(errorCode)]
                     NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_deleteFile), object: nil, userInfo: userInfo)
                     
                     if count == metadatas.count {