Ver Fonte

Add Maintenance Mode

Marino Faggiana há 7 anos atrás
pai
commit
6053f29fa7

+ 2 - 2
iOSClient/AppDelegate.h

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

+ 15 - 11
iOSClient/AppDelegate.m

@@ -337,8 +337,8 @@
 //
 - (void)applicationInitialized
 {
-    // Test Upgrade
-    if (self.upgradeInProgress)
+    // Test Maintenance
+    if (self.maintenanceMode)
         return;
 
     // Execute : now
@@ -374,8 +374,8 @@
 
 - (void)process
 {
-    // Test Upgrade
-    if (self.upgradeInProgress)
+    // Test Maintenance
+    if (self.maintenanceMode)
         return;
     
     // BACKGROND & FOREGROUND
@@ -932,6 +932,10 @@
 
 - (void)handleTouchTabbarCenter:(id)sender
 {
+    // Test Maintenance
+    if (self.maintenanceMode)
+        return;
+    
     CreateMenuAdd *menuAdd = [[CreateMenuAdd alloc] initWithThemingColor:[NCBrandColor sharedInstance].brand];
     
     if ([CCUtility getCreateMenuEncrypted])
@@ -942,8 +946,8 @@
 
 - (void)updateApplicationIconBadgeNumber
 {
-    // Test Upgrade
-    if (self.upgradeInProgress)
+    // Test Maintenance
+    if (self.maintenanceMode)
         return;
 
     NSInteger queueDownload = [self getNumberDownloadInQueues] + [self getNumberDownloadInQueuesWWan];
@@ -1370,8 +1374,8 @@
 
 - (void)verifyDownloadUploadInProgress
 {
-    // Test Upgrade
-    if (self.upgradeInProgress)
+    // Test Maintenance
+    if (self.maintenanceMode)
         return;
 
     BOOL callVerifyDownload = NO;
@@ -1556,7 +1560,7 @@
 - (BOOL)upgrade
 {
 #ifdef DEBUG
-   
+    //self.maintenanceMode = YES;
 #endif
     
     NSString *actualVersion = [CCUtility getVersionCryptoCloud];
@@ -1575,7 +1579,7 @@
     
     if (([actualVersion compare:@"2.17.4" options:NSNumericSearch] == NSOrderedAscending)) {
         
-        self.upgradeInProgress = YES;
+        self.maintenanceMode = YES;
         
         // Migrate Account Table From CoreData to Realm
         
@@ -1591,7 +1595,7 @@
         for (TableLocalFile *localFile in listLocalFile)
             [[NCManageDatabase sharedInstance] addTableLocalFileFromCoredata:localFile];
         
-        self.upgradeInProgress = NO;
+        self.maintenanceMode = NO;
     }
     
     return YES;

+ 1 - 1
iOSClient/Brand/Picker.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.17.4</string>
 	<key>CFBundleVersion</key>
-	<string>00006</string>
+	<string>00007</string>
 	<key>NSExtension</key>
 	<dict>
 		<key>NSExtensionAttributes</key>

+ 1 - 1
iOSClient/Brand/PickerFileProvider.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.17.4</string>
 	<key>CFBundleVersion</key>
-	<string>00006</string>
+	<string>00007</string>
 	<key>NSExtension</key>
 	<dict>
 		<key>NSExtensionFileProviderDocumentGroup</key>

+ 1 - 1
iOSClient/Brand/Share.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.17.4</string>
 	<key>CFBundleVersion</key>
-	<string>00006</string>
+	<string>00007</string>
 	<key>NSAppTransportSecurity</key>
 	<dict>
 		<key>NSAllowsArbitraryLoads</key>

+ 1 - 1
iOSClient/Brand/iOSClient.plist

@@ -69,7 +69,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>00006</string>
+	<string>00007</string>
 	<key>Fabric</key>
 	<dict>
 		<key>APIKey</key>

+ 6 - 1
iOSClient/Main/CCMain.m

@@ -1959,8 +1959,13 @@
 - (void)readFolderWithForced:(BOOL)forced serverUrl:(NSString *)serverUrl
 {
     // init control
-    if (!serverUrl || !app.activeAccount)
+    if (!serverUrl || !app.activeAccount || app.maintenanceMode) {
+        
+        [_hud hideHud];
+        [_refreshControl endRefreshing];
+        
         return;
+    }
     
     // Search Mode
     if (_isSearchMode) {