marinofaggiana 4 éve
szülő
commit
6ec6dbc26e

+ 7 - 0
iOSClient/Favorites/NCFavorite.swift

@@ -38,6 +38,13 @@ class NCFavorite: NCCollectionViewCommon  {
         DZNdescription = "_tutorial_favorite_view_"
     }
     
+    // MARK: - NotificationCenter
+    
+    override func reloadDataSource(_ notification: NSNotification) {
+        if self.view?.window == nil { return }
+        reloadDataSource()
+    }
+    
     // MARK: - DataSource + NC Endpoint
     
     override func reloadDataSource() {

+ 5 - 0
iOSClient/Files/NCFiles.swift

@@ -58,6 +58,11 @@ class NCFiles: NCCollectionViewCommon  {
         
         super.initializeMain()
     }
+        
+    override func reloadDataSource(_ notification: NSNotification) {
+        if self.view?.window == nil { return }
+        reloadDataSource()
+    }
     
     // MARK: - DataSource + NC Endpoint
     

+ 1 - 3
iOSClient/Main/Collection/NCCollectionViewCommon.swift

@@ -922,9 +922,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         autoUploadFileName = NCManageDatabase.sharedInstance.getAccountAutoUploadFileName()
         autoUploadDirectory = NCManageDatabase.sharedInstance.getAccountAutoUploadDirectory(urlBase: appDelegate.urlBase, account: appDelegate.account)
     }
-    @objc func reloadDataSource(_ notification: NSNotification) {
-        
-    }
+    @objc func reloadDataSource(_ notification: NSNotification) { }
     @objc func reloadDataSourceNetwork(forced: Bool = false) { }
     @objc func reloadDataSourceNetworkRefreshControl() {
         reloadDataSourceNetwork(forced: true)

+ 3 - 3
iOSClient/Networking/NCNetworking.swift

@@ -736,9 +736,9 @@ import Queuer
                     let metadatasResult = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND status == %d", account, serverUrl, k_metadataStatusNormal))
                     let metadatasChanged = NCManageDatabase.sharedInstance.updateMetadatas(metadatas, metadatasResult: metadatasResult, addCompareEtagLocal: true)
                         
-                    if metadatasChanged.metadatasUpdate.count > 0 {
-                        NotificationCenter.default.postOnMainThread(name: k_notificationCenter_reloadDataSource, userInfo: ["serverUrl":serverUrl])
-                    }
+//                    if metadatasChanged.metadatasUpdate.count > 0 {
+//                        NotificationCenter.default.postOnMainThread(name: k_notificationCenter_reloadDataSource, userInfo: ["serverUrl":serverUrl])
+//                    }
                     
                     completion(account, metadataFolder, metadatas, metadatasChanged.metadatasUpdate, metadatasChanged.metadatasLocalUpdate, errorCode, "")
                 }

+ 7 - 0
iOSClient/Offline/NCOffline.swift

@@ -38,6 +38,13 @@ class NCOffline: NCCollectionViewCommon  {
         DZNdescription = "_tutorial_offline_view_"
     }
     
+    // MARK: - NotificationCenter
+    
+    override func reloadDataSource(_ notification: NSNotification) {
+        if self.view?.window == nil { return }
+        reloadDataSource()
+    }
+    
     // MARK: - DataSource + NC Endpoint
 
     override func reloadDataSource() {