Преглед изворни кода

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) {