فهرست منبع

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 سال پیش
والد
کامیت
f4b8ae0c12
2فایلهای تغییر یافته به همراه4 افزوده شده و 5 حذف شده
  1. 1 2
      iOSClient/Main/Collection Common/NCCollectionViewCommon.swift
  2. 3 3
      iOSClient/Transfers/NCTransfers.swift

+ 1 - 2
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -1007,8 +1007,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     // MARK: - DataSource + NC Endpoint
 
     @objc func reloadDataSource(forced: Bool = true) {
-
-        if appDelegate.account == "" { return }
+        guard !appDelegate.account.isEmpty else { return }
 
         // Get richWorkspace Text
         let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.account, serverUrl))

+ 3 - 3
iOSClient/Transfers/NCTransfers.swift

@@ -167,7 +167,7 @@ class NCTransfers: NCCollectionViewCommon, NCTransferCellDelegate {
         cell.fileUser = metadata.ownerId
         cell.indexPath = indexPath
 
-        cell.imageItem.image = nil
+        cell.imageItem.image = NCBrandColor.cacheImages.file
         cell.imageItem.backgroundColor = nil
 
         cell.labelTitle.text = metadata.fileNameView
@@ -187,7 +187,7 @@ class NCTransfers: NCCollectionViewCommon, NCTransferCellDelegate {
 
         if FileManager().fileExists(atPath: iconImagePath) {
             cell.imageItem.image =  UIImage(contentsOfFile:iconImagePath)
-        } else if FileManager().fileExists(atPath: imagePath) {
+        } else if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue, FileManager().fileExists(atPath: imagePath) {
             if let image = UIImage(contentsOfFile: imagePath), let image = image.resizeImage(size: CGSize(width: NCGlobal.shared.sizeIcon, height: NCGlobal.shared.sizeIcon), isAspectRation: true), let data = image.jpegData(compressionQuality: 0.5) {
                 do {
                     try data.write(to: URL.init(fileURLWithPath: iconImagePath), options: .atomic)
@@ -195,7 +195,7 @@ class NCTransfers: NCCollectionViewCommon, NCTransferCellDelegate {
                 } catch { }
             }
         } else {
-            cell.imageItem.image = NCBrandColor.cacheImages.file
+            cell.imageItem.image = UIImage(named: metadata.iconName)
         }
 
         cell.labelInfo.text = CCUtility.dateDiff(metadata.date as Date) + " · " + CCUtility.transformedSize(metadata.size)