소스 검색

update nextcloudkit

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 년 전
부모
커밋
2a5cfb50f5
3개의 변경된 파일15개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 0
      iOSClient/Groupfolders/NCGroupfolders.swift
  2. 1 1
      iOSClient/Settings/CCManageAutoUpload.m
  3. 12 1
      iOSClient/Utility/NCContentPresenter.swift

+ 2 - 0
iOSClient/Groupfolders/NCGroupfolders.swift

@@ -131,6 +131,8 @@ class NCGroupfolders: NCCollectionViewCommon {
                             NCOperationQueue.shared.readFile(serverUrlFileName: serverUrlFileName)
                         }
                     }
+                } else if error != .success {
+                    NCContentPresenter.shared.showError(error: error)
                 }
                 self.reloadDataSource()
             }

+ 1 - 1
iOSClient/Settings/CCManageAutoUpload.m

@@ -422,7 +422,7 @@
 
         NSString* home = [[NCUtilityFileSystem shared] getHomeServerWithUrlBase:appDelegate.urlBase userId:appDelegate.userId];
         if ([serverUrl isEqualToString:home]) {
-            NKError *error = [[NKError alloc] initWithErrorCode:NCGlobal.shared.errorInternalError errorDescription:@"_autoupload_error_select_folder_"];
+            NKError *error = [[NKError alloc] initWithErrorCode:NCGlobal.shared.errorInternalError errorDescription:@"_autoupload_error_select_folder_" responseData:nil];
             [[NCContentPresenter shared] messageNotification:@"_error_" error:error delay:[[NCGlobal shared] dismissAfterSecond] type:messageTypeError];
             return;
         }

+ 12 - 1
iOSClient/Utility/NCContentPresenter.swift

@@ -110,9 +110,20 @@ class NCContentPresenter: NSObject {
                 let image = UIImage(named: "networkInProgress")!.image(color: .white, size: 20)
                 self.noteTop(text: NSLocalizedString(title, comment: ""), image: image, color: .lightGray, delay: delay, priority: .max)
             default:
+                var responseMessage = ""
+                if let data = error.responseData {
+                    do {
+                        if let json = try JSONSerialization.jsonObject(with: data, options: .mutableContainers) as? [String:Any],
+                           let message = json["message"] as? String {
+                            responseMessage = "\n\n" + message
+                        }
+                    } catch {
+                        print("Something went wrong")
+                    }
+                }
                 if error.errorDescription.trimmingCharacters(in: .whitespacesAndNewlines) == "" { return }
                 let description = NSLocalizedString(error.errorDescription, comment: "")
-                self.flatTop(title: NSLocalizedString(title, comment: ""), description: description, delay: delay, imageName: nil, type: type, priority: priority, dropEnqueuedEntries: dropEnqueuedEntries)
+                self.flatTop(title: NSLocalizedString(title, comment: ""), description: description + responseMessage, delay: delay, imageName: nil, type: type, priority: priority, dropEnqueuedEntries: dropEnqueuedEntries)
             }
         }
     }