marinofaggiana 4 years ago
parent
commit
d3619d27cc

+ 6 - 5
iOSClient/Favorites/NCFavorite.swift

@@ -313,6 +313,11 @@ class NCFavorite: UIViewController, UIGestureRecognizerDelegate, NCListCellDeleg
     
     // MARK: SEGUE
     
+    @objc func segue(metadata: tableMetadata) {
+        self.metadataPush = metadata
+        performSegue(withIdentifier: "segueDetail", sender: self)
+    }
+    
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
         
         let photoDataSource: NSMutableArray = []
@@ -403,11 +408,7 @@ extension NCFavorite: UICollectionViewDelegate {
             if CCUtility.fileProviderStorageExists(metadataPush?.ocId, fileNameView: metadataPush?.fileNameView) {
                 performSegue(withIdentifier: "segueDetail", sender: self)
             } else {
-                NCNetworking.shared.download(metadata: metadataPush!, selector: "") { (errorCode) in
-                    if errorCode == 0 {
-                        self.performSegue(withIdentifier: "segueDetail", sender: self)
-                    }
-                }
+                NCNetworking.shared.download(metadata: metadataPush!, selector: selectorLoadFileViewFavorite) { (_) in }
             }
         }
     }

+ 3 - 3
iOSClient/Networking/NCNetworkingNotificationCenter.swift

@@ -77,10 +77,10 @@ import Foundation
                                 
                             } else {
                                 
-                                if appDelegate.activeMain.view.window != nil {
+                                if appDelegate.activeMain.view.window != nil && selector == selectorLoadFileView{
                                     appDelegate.activeMain.shouldPerformSegue(metadata, selector: selector)
-                                } else if appDelegate.activeFavorite.view.window != nil {
-                                    //appDelegate.activeFavorite.shouldPerformSegue(metadata, selector: selector)
+                                } else if appDelegate.activeFavorite.view.window != nil && selector == selectorLoadFileViewFavorite{
+                                    appDelegate.activeFavorite.segue(metadata: metadata)
                                 }
                             }
                         }