Browse Source

test

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 years ago
parent
commit
19d33193fd
2 changed files with 14 additions and 4 deletions
  1. 13 3
      iOSClient/Files/NCFiles.swift
  2. 1 1
      iOSClient/Main/NCFunctionCenter.swift

+ 13 - 3
iOSClient/Files/NCFiles.swift

@@ -54,6 +54,12 @@ class NCFiles: NCCollectionViewCommon {
         super.viewWillAppear(animated)
     }
 
+    override func viewWillDisappear(_ animated: Bool) {
+        super.viewWillDisappear(animated)
+
+        fileNameBlink = nil
+    }
+
     // MARK: - NotificationCenter
 
     override func initialize(_ notification: NSNotification) {
@@ -112,8 +118,10 @@ class NCFiles: NCCollectionViewCommon {
 
             DispatchQueue.main.async {
                 self.collectionView.reloadData()
-                self.blinkCell(fileName: self.fileNameBlink)
-                self.fileNameBlink = nil
+                if !self.dataSource.metadatas.isEmpty {
+                    self.blinkCell(fileName: self.fileNameBlink)
+                    self.fileNameBlink = nil
+                }
             }
         }
     }
@@ -141,7 +149,9 @@ class NCFiles: NCCollectionViewCommon {
             if metadatasUpdate?.count ?? 0 > 0 || metadatasDelete?.count ?? 0 > 0 || forced {
                 self.reloadDataSource(forced: false)
             } else if self.dataSource.getMetadataSourceForAllSections().isEmpty {
-                DispatchQueue.main.async { self.collectionView.reloadData() }
+                DispatchQueue.main.async {
+                    self.collectionView.reloadData()
+                }
             }
         }
     }

+ 1 - 1
iOSClient/Main/NCFunctionCenter.swift

@@ -456,7 +456,7 @@ import Photos
 
     func openFileViewInFolder(serverUrl: String, fileNameBlink: String?) {
 
-        DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
+        DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
             var topNavigationController: UINavigationController?
             var pushServerUrl = NCUtilityFileSystem.shared.getHomeServer(account: self.appDelegate.account)
             var mostViewController = UIApplication.shared.keyWindow!.rootViewController!.topMostViewController()