소스 검색

improved code

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 년 전
부모
커밋
a8d860e071
1개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. 9 4
      iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

+ 9 - 4
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -430,11 +430,16 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
 
     @objc func createFolder(_ notification: NSNotification) {
 
-        if let userInfo = notification.userInfo as NSDictionary?, let ocId = userInfo["ocId"] as? String, let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId), (metadata.serverUrl == serverUrl && metadata.account == appDelegate.account ) {
-            pushMetadata(metadata)
-        } else {
-            reloadDataSourceNetwork()
+        guard let userInfo = notification.userInfo as NSDictionary?,
+              let ocId = userInfo["ocId"] as? String,
+              let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId),
+              metadata.serverUrl == serverUrl,
+              metadata.account == appDelegate.account
+        else {
+            return
         }
+
+        pushMetadata(metadata)
     }
 
     @objc func favoriteFile(_ notification: NSNotification) {