Procházet zdrojové kódy

Improvements

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana před 2 roky
rodič
revize
0e61a2fa52
1 změnil soubory, kde provedl 3 přidání a 6 odebrání
  1. 3 6
      iOSClient/Files/NCFiles.swift

+ 3 - 6
iOSClient/Files/NCFiles.swift

@@ -77,6 +77,9 @@ class NCFiles: NCCollectionViewCommon {
     override func reloadDataSource(forced: Bool = true) {
         super.reloadDataSource()
 
+        DispatchQueue.main.async {
+            self.refreshControl.endRefreshing()
+        }
         guard !isSearching, !appDelegate.account.isEmpty, !appDelegate.urlBase.isEmpty, !serverUrl.isEmpty else { return }
 
         self.metadatasSource = NCManageDatabase.shared.getMetadatas(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.account, serverUrl))
@@ -104,7 +107,6 @@ class NCFiles: NCCollectionViewCommon {
             searchResults: self.searchResults)
 
         DispatchQueue.main.async {
-            self.refreshControl.endRefreshing()
             self.collectionView.reloadData()
         }
     }
@@ -130,11 +132,6 @@ class NCFiles: NCCollectionViewCommon {
             self.isReloadDataSourceNetworkInProgress = false
             self.richWorkspaceText = tableDirectory?.richWorkspace
 
-            DispatchQueue.main.async {
-                self.refreshControl.endRefreshing()
-                self.collectionView?.reloadData()
-            }
-
             if metadatasUpdate?.count ?? 0 > 0 || metadatasDelete?.count ?? 0 > 0 || forced {
                 self.reloadDataSource(forced: false)
             }