Explorar el Código

Merge pull request #1744 from nextcloud/fix/distinct-sharess

Marino Faggiana hace 3 años
padre
commit
d6137782c4
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      iOSClient/Shares/NCShares.swift

+ 3 - 1
iOSClient/Shares/NCShares.swift

@@ -49,7 +49,9 @@ class NCShares: NCCollectionViewCommon  {
             let sharess = NCManageDatabase.shared.getTableShares(account: self.appDelegate.account)
             for share in sharess {
                 if let metadata = NCManageDatabase.shared.getMetadata(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND fileName == %@", self.appDelegate.account, share.serverUrl, share.fileName)) {
-                    self.metadatasSource.append(metadata)
+                    if !(self.metadatasSource.contains { $0.ocId == metadata.ocId }) {
+                        self.metadatasSource.append(metadata)
+                    }
                 }
             }