浏览代码

Perf:Avoid redundant reading and decrypting all collections

Neeraj Gupta 2 年之前
父节点
当前提交
90bb00fefb
共有 1 个文件被更改,包括 4 次插入1 次删除
  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();