marinofaggiana 6 жил өмнө
parent
commit
371d3f3fbf

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -3764,7 +3764,7 @@
                 for (NSString *key in sectionDataSource.fileIDIndexPath) {
                     if ([key isEqualToString:metadata.fileID]) {
                         NSIndexPath *indexPath = [sectionDataSource.fileIDIndexPath objectForKey:key];
-                        [self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionMiddle animated:NO];
+                        [self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:NO];
                         [self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
                         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
                             [self.tableView deselectRowAtIndexPath:indexPath animated:YES];

+ 3 - 5
iOSClient/Trash/NCTrash.swift

@@ -655,11 +655,9 @@ extension NCTrash {
                     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)
-                        if let cell = self.collectionView.cellForItem(at: self.scrollToIndexPath!) as? NCTrashListCell {
-                            cell.backgroundColor = NCBrandColor.sharedInstance.brandElement
-                            UIView.animate(withDuration: 1.0, animations: {
-                                cell.backgroundColor = .white
-                            })
+                        self.collectionView.selectItem(at: self.scrollToIndexPath, animated: true, scrollPosition: UICollectionView.ScrollPosition(rawValue: 1))
+                        DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
+                            self.collectionView.deselectItem(at: self.scrollToIndexPath!, animated: true)
                         }
                     }
                 }

+ 3 - 0
iOSClient/Utility/NCUtility.swift

@@ -246,6 +246,9 @@ class NCUtility: NSObject {
                     return closure(nil)
                 }
             })
+            
+        } else {
+            return closure(imageNamePath)
         }
     }