marinofaggiana 6 tahun lalu
induk
melakukan
4b452596d2
1 mengubah file dengan 11 tambahan dan 15 penghapusan
  1. 11 15
      iOSClient/Trash/NCTrash.swift

+ 11 - 15
iOSClient/Trash/NCTrash.swift

@@ -105,21 +105,6 @@ class NCTrash: UIViewController, UIGestureRecognizerDelegate, NCTrashListCellDel
         loadListingTrash()
     }
     
-    override func viewDidAppear(_ animated: Bool) {
-        super.viewDidAppear(animated)
-        
-        if scrollToFileID != "" {
-            DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
-                for item in 0...self.datasource.count-1 {
-                    if self.datasource[item].fileID.contains(self.scrollToFileID) {
-                        self.scrollToIndexPath = IndexPath(item: item, section: 0)
-                        self.collectionView.scrollToItem(at: self.scrollToIndexPath!, at: .top, animated: true)
-                    }
-                }
-            }
-        }
-    }
-    
     override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
         super.viewWillTransition(to: size, with: coordinator)
         
@@ -691,6 +676,17 @@ extension NCTrash {
             }
             
             self.loadDatasource()
+            
+            // GoTo FileID
+            if self.scrollToFileID != "" {
+                for item in 0...self.datasource.count-1 {
+                    if self.datasource[item].fileID.contains(self.scrollToFileID) {
+                        self.scrollToIndexPath = IndexPath(item: item, section: 0)
+                        self.collectionView.scrollToItem(at: self.scrollToIndexPath!, at: .top, animated: true)
+                    }
+                }
+                self.scrollToFileID = ""
+            }
         })
     }