浏览代码

Merge pull request #249 from ente-io/fix_order

Process updated files in the end
Neeraj Gupta 3 年之前
父节点
当前提交
4c74ca8f0d
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      lib/services/remote_sync_service.dart

+ 11 - 0
lib/services/remote_sync_service.dart

@@ -465,5 +465,16 @@ class RemoteSyncService {
         return -1;
       }
     });
+    // move updated files towards the end
+    file.sort((first, second) {
+      if (first.updationTime == second.updationTime) {
+        return 0;
+      }
+      if (first.updationTime == -1) {
+        return 1;
+      } else {
+        return -1;
+      }
+    });
   }
 }