Browse Source

Skip sync if already in progress

Vishnu Mohandas 4 years ago
parent
commit
93b38bbe43
1 changed files with 3 additions and 0 deletions
  1. 3 0
      lib/main.dart

+ 3 - 0
lib/main.dart

@@ -64,6 +64,9 @@ Future _init() async {
 }
 
 Future<void> _sync({bool isAppInBackground = false}) async {
+  if (SyncService.instance.isSyncInProgress()) {
+    return;
+  }
   try {
     await SyncService.instance.sync(isAppInBackground: isAppInBackground);
   } catch (e, s) {