Explorar o código

Fix rename error when filename doesn't change

Signed-off-by: Henrik Storch <henrik.storch@nextcloud.com>
Henrik Storch %!s(int64=3) %!d(string=hai) anos
pai
achega
c85e616f87
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      Share/NCShareExtension+NCDelegate.swift

+ 1 - 0
Share/NCShareExtension+NCDelegate.swift

@@ -131,6 +131,7 @@ extension NCShareExtension: NCShareCellDelegate, NCRenameFileDelegate, NCListCel
     }
 
     func rename(fileName: String, fileNameNew: String) {
+        guard fileName != fileNameNew else { return }
         guard let fileIx = self.filesName.firstIndex(of: fileName),
               !self.filesName.contains(fileNameNew),
               NCUtilityFileSystem.shared.moveFile(atPath: (NSTemporaryDirectory() + fileName), toPath: (NSTemporaryDirectory() + fileNameNew)) else {