marinofaggiana 4 years ago
parent
commit
823a428689

+ 11 - 0
iOSClient/Favorites/NCFavorite.swift

@@ -38,6 +38,17 @@ class NCFavorite: NCCollectionViewCommon  {
         DZNdescription = "_tutorial_favorite_view_"
     }
     
+    override func viewWillAppear(_ animated: Bool) {
+        
+        if serverUrl == "" {
+            appDelegate.activeServerUrl = NCUtility.shared.getHomeServer(urlBase: appDelegate.urlBase, account: appDelegate.account)
+        } else {
+            appDelegate.activeServerUrl = self.serverUrl
+        }
+        
+        super.viewWillAppear(animated)
+    }
+    
     // MARK: - Collection View
     
     override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {

+ 0 - 6
iOSClient/Main/Collection/NCCollectionViewCommon.swift

@@ -161,12 +161,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
             collectionView?.collectionViewLayout = gridLayout
         }
         
-        if serverUrl == "" {
-            appDelegate.activeServerUrl = NCUtility.shared.getHomeServer(urlBase: appDelegate.urlBase, account: appDelegate.account)
-        } else {
-            appDelegate.activeServerUrl = self.serverUrl
-        }
-        
         setNavigationItem()
         reloadDataSource()
     }

+ 11 - 0
iOSClient/Offline/NCOffline.swift

@@ -38,6 +38,17 @@ class NCOffline: NCCollectionViewCommon  {
         DZNdescription = "_tutorial_offline_view_"
     }
     
+    override func viewWillAppear(_ animated: Bool) {
+        
+        if serverUrl == "" {
+            appDelegate.activeServerUrl = NCUtility.shared.getHomeServer(urlBase: appDelegate.urlBase, account: appDelegate.account)
+        } else {
+            appDelegate.activeServerUrl = self.serverUrl
+        }
+        
+        super.viewWillAppear(animated)
+    }
+    
     // MARK: - Collection View
     
     override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {