Browse Source

Merge pull request #850 from ente-io/fix_bug_in_mapping_files

Fix bug in mapping existingFilesInDifferentCollection
Vishnu Mohandas 2 years ago
parent
commit
e6a131c291
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/utils/file_uploader.dart

+ 3 - 1
lib/utils/file_uploader.dart

@@ -603,7 +603,9 @@ class FileUploader {
     // case c and d
     final File? fileExistsButDifferentCollection =
         existingUploadedFiles.firstWhereOrNull(
-      (e) => e.collectionID != toCollectionID,
+      (e) =>
+          e.collectionID != toCollectionID &&
+          (e.localID == null || e.localID == fileToUpload.localID),
     );
     if (fileExistsButDifferentCollection != null) {
       _logger.fine(