Browse Source

add // Test Upgrade - self.upgradeInProgress

Marino Faggiana 7 years ago
parent
commit
bebfaff42b
2 changed files with 23 additions and 0 deletions
  1. 3 0
      iOSClient/AppDelegate.h
  2. 20 0
      iOSClient/AppDelegate.m

+ 3 - 0
iOSClient/AppDelegate.h

@@ -136,6 +136,9 @@
 // Is in Crypto Mode
 // Is in Crypto Mode
 @property BOOL isCryptoCloudMode;
 @property BOOL isCryptoCloudMode;
 
 
+// Is in Upgrade Mode
+@property BOOL upgradeInProgress;
+
 // Setting Active Account
 // Setting Active Account
 - (void)settingActiveAccount:(NSString *)activeAccount activeUrl:(NSString *)activeUrl activeUser:(NSString *)activeUser activePassword:(NSString *)activePassword;
 - (void)settingActiveAccount:(NSString *)activeAccount activeUrl:(NSString *)activeUrl activeUser:(NSString *)activeUser activePassword:(NSString *)activePassword;
 
 

+ 20 - 0
iOSClient/AppDelegate.m

@@ -337,6 +337,10 @@
 //
 //
 - (void)applicationInitialized
 - (void)applicationInitialized
 {
 {
+    // Test Upgrade
+    if (self.upgradeInProgress)
+        return;
+
     // Execute : now
     // Execute : now
     
     
     NSLog(@"[LOG] Update Folder Photo");
     NSLog(@"[LOG] Update Folder Photo");
@@ -370,6 +374,10 @@
 
 
 - (void)process
 - (void)process
 {
 {
+    // Test Upgrade
+    if (self.upgradeInProgress)
+        return;
+    
     // BACKGROND & FOREGROUND
     // BACKGROND & FOREGROUND
 
 
     NSLog(@"-PROCESS-AUTO-UPLOAD-");
     NSLog(@"-PROCESS-AUTO-UPLOAD-");
@@ -934,6 +942,10 @@
 
 
 - (void)updateApplicationIconBadgeNumber
 - (void)updateApplicationIconBadgeNumber
 {
 {
+    // Test Upgrade
+    if (self.upgradeInProgress)
+        return;
+
     NSInteger queueDownload = [self getNumberDownloadInQueues] + [self getNumberDownloadInQueuesWWan];
     NSInteger queueDownload = [self getNumberDownloadInQueues] + [self getNumberDownloadInQueuesWWan];
     NSInteger queueUpload = [self getNumberUploadInQueues] + [self getNumberUploadInQueuesWWan];
     NSInteger queueUpload = [self getNumberUploadInQueues] + [self getNumberUploadInQueuesWWan];
     
     
@@ -1358,6 +1370,10 @@
 
 
 - (void)verifyDownloadUploadInProgress
 - (void)verifyDownloadUploadInProgress
 {
 {
+    // Test Upgrade
+    if (self.upgradeInProgress)
+        return;
+
     BOOL callVerifyDownload = NO;
     BOOL callVerifyDownload = NO;
     BOOL callVerifyUpload = NO;
     BOOL callVerifyUpload = NO;
     
     
@@ -1559,6 +1575,8 @@
     
     
     if (([actualVersion compare:@"2.17.4" options:NSNumericSearch] == NSOrderedAscending)) {
     if (([actualVersion compare:@"2.17.4" options:NSNumericSearch] == NSOrderedAscending)) {
         
         
+        self.upgradeInProgress = YES;
+        
         // Migrate Account Table From CoreData to Realm
         // Migrate Account Table From CoreData to Realm
         
         
         NSArray *listAccount = [CCCoreData migrateAccount];
         NSArray *listAccount = [CCCoreData migrateAccount];
@@ -1572,6 +1590,8 @@
         NSArray *listLocalFile = [CCCoreData migrateLocalFile];
         NSArray *listLocalFile = [CCCoreData migrateLocalFile];
         for (TableLocalFile *localFile in listLocalFile)
         for (TableLocalFile *localFile in listLocalFile)
             [[NCManageDatabase sharedInstance] addTableLocalFileFromCoredata:localFile];
             [[NCManageDatabase sharedInstance] addTableLocalFileFromCoredata:localFile];
+        
+        self.upgradeInProgress = NO;
     }
     }
     
     
     return YES;
     return YES;