Browse Source

Perf:Avoid redundant reading and decrypting all collections

Neeraj Gupta 2 years ago
parent
commit
90bb00fefb
1 changed files with 4 additions and 1 deletions
  1. 4 1
      lib/services/collections_service.dart

+ 4 - 1
lib/services/collections_service.dart

@@ -101,7 +101,10 @@ class CollectionsService {
     // Might not have synced the collection fully
     final fetchedCollections =
         await _fetchCollections(lastCollectionUpdationTime);
-    watch.log("remote fetch");
+    watch.log("remote fetch collections ${fetchedCollections.length}");
+    if (fetchedCollections.isEmpty) {
+      return;
+    }
     final updatedCollections = <Collection>[];
     int maxUpdationTime = lastCollectionUpdationTime;
     final ownerID = _config.getUserID();