Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

fix: don't go in other users owned files block when not trying to copy

Prateek Sunala4d29adaf4af
diff --git a/mobile/apps/photos/lib/services/collections_service.dart b/mobile/apps/photos/lib/services/collections_service.dart
index ad4a0c2dfb..43179ab2d6 100644
--- a/mobile/apps/photos/lib/services/collections_service.dart
+++ b/mobile/apps/photos/lib/services/collections_service.dart
@@ -1413,10 +1413,8 @@ class CollectionsService {
if (splitResult.ownedByCurrentUser.isNotEmpty) {
await _addToCollection(dstCollectionID, splitResult.ownedByCurrentUser);
}
- if (splitResult.ownedByOtherUsers.isNotEmpty) {
- late final List<EnteFile> filesToCopy;
- late final List<EnteFile> filesToAdd;
- (filesToAdd, filesToCopy) = (await _splitFilesToAddAndCopy(
+ if (splitResult.ownedByOtherUsers.isNotEmpty && toCopy) {
+ final (filesToAdd, filesToCopy) = (await _splitFilesToAddAndCopy(
splitResult.ownedByOtherUsers,
));
@@ -1426,9 +1424,7 @@ class CollectionsService {
);
await _addToCollection(dstCollectionID, filesToAdd);
}
- if (!toCopy) {
- return;
- }
+
// group files by collectionID
final Map<int, List<EnteFile>> filesByCollection = {};
final Map<int, Set<int>> fileSeenByCollection = {};