Browse Source

Remove redundant API call to add uploaded file to it's existing collection

Vishnu Mohandas 4 năm trước cách đây
mục cha
commit
e47c7841a3

+ 2 - 1
lib/services/favorites_service.dart

@@ -66,8 +66,9 @@ class FavoritesService {
     if (fileID == null) {
     if (fileID == null) {
       file.collectionID = collectionID;
       file.collectionID = collectionID;
       fileID = (await _fileUploader.encryptAndUploadFile(file)).uploadedFileID;
       fileID = (await _fileUploader.encryptAndUploadFile(file)).uploadedFileID;
+    } else {
+      return _collectionsService.addToCollection(collectionID, [file]);
     }
     }
-    return _collectionsService.addToCollection(collectionID, [file]);
   }
   }
 
 
   Future<int> getOrCreateFavoriteCollectionID() async {
   Future<int> getOrCreateFavoriteCollectionID() async {