瀏覽代碼

MEGA coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 年之前
父節點
當前提交
13061c6d05
共有 2 個文件被更改,包括 9 次插入0 次删除
  1. 7 0
      iOSClient/Data/NCDataSource.swift
  2. 2 0
      iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

+ 7 - 0
iOSClient/Data/NCDataSource.swift

@@ -61,6 +61,13 @@ class NCDataSource: NSObject {
 
     // MARK: -
 
+    func clearDataSource() {
+
+        self.metadatasSource.removeAll()
+        self.metadatasForSection.removeAll()
+        self.sectionsValue.removeAll()
+    }
+
     func createSections() {
 
         self.sectionsValue = metadatasSource.map { getSectionValue(metadata: $0) }

+ 2 - 0
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -984,6 +984,8 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         }
 
         isReloadDataSourceNetworkInProgress = true
+        self.metadatasSource.removeAll()
+        self.dataSource.clearDataSource()
         collectionView?.reloadData()
         
         let serverVersionMajor = NCManageDatabase.shared.getCapabilitiesServerInt(account: appDelegate.account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)