Browse Source

Verify if blocked Table Automatic Upload

Marino Faggiana 8 năm trước cách đây
mục cha
commit
527697e49d

+ 1 - 0
iOSClient/AppDelegate.h

@@ -181,6 +181,7 @@
 // Operation Networking
 - (void)cancelAllOperations;
 - (void)addNetworkingOperationQueue:(NSOperationQueue *)netQueue delegate:(id)delegate metadataNet:(CCMetadataNet *)metadataNet oneByOne:(BOOL)oneByOne;
+- (BOOL)verifyExistsInQueue:(NSOperationQueue *)queue selector:(NSString *)selector;
 - (void)loadTableAutomaticUploadForSelector:(NSString *)selector;
 
 - (void)dropAutomaticUploadWithSelector:(NSString *)selector;

+ 1 - 9
iOSClient/AppDelegate.m

@@ -248,15 +248,7 @@
 //
 - (void)applicationDidBecomeActive:(UIApplication *)application
 {
-    // Verify if load new asset for Automatic Upload
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 3.0 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
-        
-        if ([self verifyExistsInQueue:_netQueueUpload selector:selectorUploadAutomatic] || [self verifyExistsInQueue:_netQueueUploadWWan selector:selectorUploadAutomatic])
-            [self loadTableAutomaticUploadForSelector:selectorUploadAutomatic];
-        
-        if ([self verifyExistsInQueue:_netQueueUpload selector:selectorUploadAutomaticAll])
-            [self loadTableAutomaticUploadForSelector:selectorUploadAutomaticAll];
-    });
+
 }
 
 //

+ 10 - 2
iOSClient/PhotosCameraUpload/CCPhotosCameraUpload.m

@@ -1103,9 +1103,17 @@
         newItemsToUpload = [manageAsset getCameraRollNewItemsWithDatePhoto:databaseDatePhoto dateVideo:databaseDateVideo];
     }
     
-    // News Assets ?
-    if ([newItemsToUpload count] == 0)
+    // News Assets ? && Verify if blocked Table Automatic Upload
+    if ([newItemsToUpload count] == 0) {
+    
+        if ([app verifyExistsInQueue:app.netQueueUpload selector:selectorUploadAutomatic] || [app verifyExistsInQueue:app.netQueueUploadWWan selector:selectorUploadAutomatic])
+            [app loadTableAutomaticUploadForSelector:selectorUploadAutomatic];
+        
+        if ([app verifyExistsInQueue:app.netQueueUpload selector:selectorUploadAutomaticAll])
+            [app loadTableAutomaticUploadForSelector:selectorUploadAutomaticAll];
+        
         return;
+    }
     
     // STOP new request : initStateCameraUpload
     _AutomaticCameraUploadInProgress = YES;