Browse Source

Merge pull request #249 from ente-io/fix_order

Process updated files in the end
Neeraj Gupta 3 years ago
parent
commit
4c74ca8f0d
1 changed files with 11 additions and 0 deletions
  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;
         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;
+      }
+    });
   }
   }
 }
 }