浏览代码

Merge pull request #850 from ente-io/fix_bug_in_mapping_files

Fix bug in mapping existingFilesInDifferentCollection
Vishnu Mohandas 2 年之前
父节点
当前提交
e6a131c291
共有 1 个文件被更改,包括 3 次插入1 次删除
  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
     // case c and d
     final File? fileExistsButDifferentCollection =
     final File? fileExistsButDifferentCollection =
         existingUploadedFiles.firstWhereOrNull(
         existingUploadedFiles.firstWhereOrNull(
-      (e) => e.collectionID != toCollectionID,
+      (e) =>
+          e.collectionID != toCollectionID &&
+          (e.localID == null || e.localID == fileToUpload.localID),
     );
     );
     if (fileExistsButDifferentCollection != null) {
     if (fileExistsButDifferentCollection != null) {
       _logger.fine(
       _logger.fine(