浏览代码

coding

Signed-off-by: marinofaggiana <marino.faggiana@nextcloud.com>
marinofaggiana 2 年之前
父节点
当前提交
4e3dc5a19a

+ 2 - 2
Widget/Nextcloud/NextcloudData.swift

@@ -239,9 +239,9 @@ func getDataEntry(completion: @escaping (_ entry: NextcloudDataEntry) -> Void) {
             if errorCode != 0 {
                 completion(NextcloudDataEntry(date: Date(), recentDatas: recentDatasTest, uploadDatas: uploadDatasTest, isPlaceholder: true, footerText: errorDescription))
             } else if recentDatas.isEmpty {
-                completion(NextcloudDataEntry(date: Date(), recentDatas: recentDatasTest, uploadDatas: uploadDatasTest, isPlaceholder: true, footerText: "Auto upoload: \(items), \(Date().formatted())"))
+                completion(NextcloudDataEntry(date: Date(), recentDatas: recentDatasTest, uploadDatas: uploadDatasTest, isPlaceholder: true, footerText: "Auto upoload: \(0), \(Date().formatted())"))
             } else {
-                completion(NextcloudDataEntry(date: Date(), recentDatas: recentDatas, uploadDatas: uploadDatas, isPlaceholder: false, footerText: "Auto upoload: \(items), \(Date().formatted())"))
+                completion(NextcloudDataEntry(date: Date(), recentDatas: recentDatas, uploadDatas: uploadDatas, isPlaceholder: false, footerText: "Auto upoload: \(0), \(Date().formatted())"))
             }
         }
     }

+ 3 - 2
Widget/Nextcloud/NextcloudWidgetView.swift

@@ -79,8 +79,9 @@ struct NextcloudWidgetView: View {
                             .clipped()
                             .cornerRadius(4)
                     }
-                }.frame(maxWidth: .infinity, alignment: .trailing)
-
+                }
+                .frame(maxWidth: .infinity, alignment: .trailing)
+                .padding(.trailing, 10)
             }
             .padding(.top, 45)
             .redacted(reason: entry.isPlaceholder ? .placeholder : [])

+ 13 - 11
iOSClient/Networking/NCAutoUpload.swift

@@ -182,18 +182,20 @@ class NCAutoUpload: NSObject {
                 }
 
                 self.endForAssetToUpload = true
-                #if !EXTENSION
-                if selector == NCGlobal.shared.selectorUploadAutoUploadAll {
-                    (UIApplication.shared.delegate as! AppDelegate).networkingProcessUpload?.createProcessUploads(metadatas: metadatas)
-                } else {
-                    (UIApplication.shared.delegate as! AppDelegate).networkingProcessUpload?.createProcessUploads(metadatas: metadatas, verifyAlreadyExists: true)
-                }
-                #elseif EXTENSION_WIDGET
-                    if selector == NCGlobal.shared.selectorUploadAutoUpload {
-                        let networkingProcessUpload = NCNetworkingProcessUpload()
-                        networkingProcessUpload.createProcessUploads(metadatas: metadatas, verifyAlreadyExists: true)
+                DispatchQueue.main.async {
+                    #if !EXTENSION
+                    if selector == NCGlobal.shared.selectorUploadAutoUploadAll {
+                        (UIApplication.shared.delegate as! AppDelegate).networkingProcessUpload?.createProcessUploads(metadatas: metadatas)
+                    } else {
+                        (UIApplication.shared.delegate as! AppDelegate).networkingProcessUpload?.createProcessUploads(metadatas: metadatas, verifyAlreadyExists: true)
                     }
-                #endif
+                    #elseif EXTENSION_WIDGET
+                        if selector == NCGlobal.shared.selectorUploadAutoUpload {
+                            let networkingProcessUpload = NCNetworkingProcessUpload()
+                            networkingProcessUpload.createProcessUploads(metadatas: metadatas, verifyAlreadyExists: true)
+                        }
+                    #endif
+                }
                 completion(metadatas.count)
             }
         }