浏览代码

add ViewerQuickLook

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

+ 5 - 4
iOSClient/Main/Create cloud/NCUploadAssets.swift

@@ -304,21 +304,22 @@ struct UploadAssetsView: View {
                             ScrollView(.horizontal) {
                                 LazyHGrid(rows: gridItems, alignment: .center, spacing: 10) {
                                     ForEach(0..<uploadAssets.previewStore.count, id: \.self) { index in
+                                        let item = uploadAssets.previewStore[index]
                                         ZStack(alignment: .bottomTrailing) {
-                                            Image(uiImage: uploadAssets.previewStore[index].image)
+                                            Image(uiImage: item.image)
                                                 .resizable()
                                                 .frame(width: uploadAssets.sizeImagePreview, height: uploadAssets.sizeImagePreview, alignment: .center)
                                                 .cornerRadius(10)
                                                 .scaledToFit()
                                                 .onTapGesture {
-                                                    if uploadAssets.previewStore[index].asset.type == .photo {
+                                                    if item.asset.type == .photo {
                                                         presentedQuickLook(size: max(geo.size.height, geo.size.height), index: index)
                                                     }
                                                 }.fullScreenCover(isPresented: $isPresentedQuickLook) {
                                                     ViewerQuickLook(url: URL(fileURLWithPath: fileNamePath), index: $index, isPresentedQuickLook: $isPresentedQuickLook, uploadAssets: uploadAssets)
                                                         .ignoresSafeArea()
                                                 }
-                                            if uploadAssets.previewStore[index].asset.type == .livePhoto {
+                                            if item.asset.type == .livePhoto {
                                                 Image(systemName: "livephoto")
                                                     .resizable()
                                                     .scaledToFit()
@@ -326,7 +327,7 @@ struct UploadAssetsView: View {
                                                     .foregroundColor(.white)
                                                     .padding(.horizontal, 5)
                                                     .padding(.vertical, 5)
-                                            } else if uploadAssets.previewStore[index].asset.type == .video {
+                                            } else if item.asset.type == .video {
                                                 Image(systemName: "video.fill")
                                                     .resizable()
                                                     .scaledToFit()