浏览代码

Improved code

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 年之前
父节点
当前提交
38b85b8ccb
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      iOSClient/Main/Create cloud/NCUploadScanDocument.swift

+ 7 - 0
iOSClient/Main/Create cloud/NCUploadScanDocument.swift

@@ -338,6 +338,8 @@ struct UploadScanDocumentView: View {
     @State var isPresentedSelect = false
     @State var isPresentedUploadConflict = false
 
+    @State private var showHUD = false
+
     var metadatasConflict: [tableMetadata] = []
 
     @ObservedObject var uploadScanDocument: NCUploadScanDocument
@@ -436,7 +438,9 @@ struct UploadScanDocumentView: View {
                     }
 
                     Button(NSLocalizedString("_save_", comment: "")) {
+                        self.showHUD.toggle()
                         uploadScanDocument.save(fileName: fileName, password: password, isTextRecognition: isTextRecognition, quality: quality) { openConflictViewController in
+                            //self.showHUD.toggle()
                             if openConflictViewController {
                                 isPresentedUploadConflict = true
                             } else {
@@ -448,6 +452,9 @@ struct UploadScanDocumentView: View {
                     .frame(maxWidth: .infinity, alignment: .center)
                     .listRowBackground(Color(UIColor.systemGroupedBackground))
                 }
+                HUDView(showHUD: $showHUD, textLabel: NSLocalizedString("_wait_", comment: ""), image: "doc.badge.arrow.up")
+                    .offset(y: showHUD ? 0 : -200)
+                    .animation(.easeOut)
             }
         }
         .background(Color(UIColor.systemGroupedBackground))