|
@@ -433,23 +433,13 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
|
|
|
@objc func downloadStartFile(_ notification: NSNotification) {
|
|
|
|
|
|
guard let userInfo = notification.userInfo as NSDictionary?,
|
|
|
- let ocId = userInfo["ocId"] as? String,
|
|
|
let serverUrl = userInfo["serverUrl"] as? String,
|
|
|
serverUrl == self.serverUrl,
|
|
|
let account = userInfo["account"] as? String,
|
|
|
account == appDelegate.account
|
|
|
else { return }
|
|
|
|
|
|
- let (indexPath, sameSections) = dataSource.reloadMetadata(ocId: ocId)
|
|
|
- if let indexPath = indexPath {
|
|
|
- if sameSections && (indexPath.section < collectionView.numberOfSections && indexPath.row < collectionView.numberOfItems(inSection: indexPath.section)) {
|
|
|
- collectionView?.reloadItems(at: [indexPath])
|
|
|
- } else {
|
|
|
- self.collectionView?.reloadData()
|
|
|
- }
|
|
|
- } else {
|
|
|
- reloadDataSource()
|
|
|
- }
|
|
|
+ reloadDataSource()
|
|
|
}
|
|
|
|
|
|
@objc func downloadedFile(_ notification: NSNotification) {
|
|
@@ -514,34 +504,13 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
|
|
|
@objc func uploadedFile(_ notification: NSNotification) {
|
|
|
|
|
|
guard let userInfo = notification.userInfo as NSDictionary?,
|
|
|
- let ocId = userInfo["ocId"] as? String,
|
|
|
- let ocIdTemp = userInfo["ocIdTemp"] as? String,
|
|
|
let serverUrl = userInfo["serverUrl"] as? String,
|
|
|
serverUrl == self.serverUrl,
|
|
|
let account = userInfo["account"] as? String,
|
|
|
account == appDelegate.account
|
|
|
else { return }
|
|
|
|
|
|
- // do not exists metadata ?
|
|
|
- guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) else {
|
|
|
- reloadDataSource()
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- let (indexPath, sameSections) = dataSource.reloadMetadata(ocId: metadata.ocId, ocIdTemp: ocIdTemp)
|
|
|
- if let indexPath = indexPath {
|
|
|
- if sameSections && (indexPath.section < collectionView.numberOfSections && indexPath.row < collectionView.numberOfItems(inSection: indexPath.section)) {
|
|
|
- collectionView?.performBatchUpdates({
|
|
|
- collectionView?.reloadItems(at: [indexPath])
|
|
|
- }, completion: { _ in
|
|
|
- self.collectionView?.reloadData()
|
|
|
- })
|
|
|
- } else {
|
|
|
- self.collectionView?.reloadData()
|
|
|
- }
|
|
|
- } else {
|
|
|
- reloadDataSource()
|
|
|
- }
|
|
|
+ reloadDataSource()
|
|
|
}
|
|
|
|
|
|
@objc func uploadCancelFile(_ notification: NSNotification) {
|