Browse Source

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

Vishnu Mohandas 4 years ago
parent
commit
e47c7841a3
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lib/services/favorites_service.dart

+ 2 - 1
lib/services/favorites_service.dart

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