Marino Faggiana 7 years ago
parent
commit
9aaeba8549
3 changed files with 17 additions and 2 deletions
  1. 2 0
      iOSClient/AppDelegate.h
  2. 11 2
      iOSClient/AppDelegate.m
  3. 4 0
      iOSClient/Settings/CCAdvanced.m

+ 2 - 0
iOSClient/AppDelegate.h

@@ -145,6 +145,8 @@
 // initializations 
 - (void)applicationInitialized;
 
+- (void)maintenanceMode:(BOOL)mode;
+
 - (void)configDynamicShortcutItems;
 
 - (void)messageNotification:(NSString *)title description:(NSString *)description visible:(BOOL)visible delay:(NSTimeInterval)delay type:(TWMessageBarMessageType)type errorCode:(NSInteger)errorcode;

+ 11 - 2
iOSClient/AppDelegate.m

@@ -1558,6 +1558,15 @@
     return YES;
 }
 
+#pragma --------------------------------------------------------------------------------------------
+#pragma mark ===== maintenance Mode =====
+#pragma --------------------------------------------------------------------------------------------
+
+- (void)maintenanceMode:(BOOL)mode
+{
+    self.maintenanceMode = mode;
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== UPGRADE =====
 #pragma --------------------------------------------------------------------------------------------
@@ -1584,7 +1593,7 @@
     
     if (([actualVersion compare:@"2.17.4" options:NSNumericSearch] == NSOrderedAscending)) {
         
-        self.maintenanceMode = YES;
+        [self maintenanceMode:YES];
         
         // Migrate Account Table From CoreData to Realm
         
@@ -1604,7 +1613,7 @@
         for (TableLocalFile *localFile in listLocalFile)
             [[NCManageDatabase sharedInstance] addTableLocalFileFromCoredata:localFile];
         
-        self.maintenanceMode = NO;
+        [self maintenanceMode:NO];
     }
     
     return YES;

+ 4 - 0
iOSClient/Settings/CCAdvanced.m

@@ -309,6 +309,8 @@
     
     [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
         
+        [app maintenanceMode:YES];
+
         [self.hud visibleHudTitle:NSLocalizedString(@"_remove_cache_", nil) mode:MBProgressHUDModeIndeterminate color:nil];
         
         [app cancelAllOperations];
@@ -340,6 +342,8 @@
             
             [self recalculateSize];
             
+            [app maintenanceMode:NO];
+
             dispatch_async(dispatch_get_main_queue(), ^{
                 // Close HUD
                 [self.hud hideHud];