Browse Source

clear code

marinofaggiana 5 years ago
parent
commit
941b21f373

+ 3 - 3
iOSClient/AppDelegate.h

@@ -46,7 +46,7 @@
 // Timer Process
 @property (nonatomic, strong) NSTimer *timerProcessAutoDownloadUpload;
 @property (nonatomic, strong) NSTimer *timerUpdateApplicationIconBadgeNumber;
-@property (nonatomic, strong) NSTimer *timerServerUnauthorized;
+@property (nonatomic, strong) NSTimer *timerErrorNetworking;
 
 // For LMMediaPlayerView
 @property (strong, nonatomic) UIWindow *window;
@@ -138,8 +138,8 @@
 // UserDefaults
 @property (nonatomic, strong) NSUserDefaults *ncUserDefaults;
 
-// Timer Server Unauthorized
-- (void)startTimerServerUnauthorized;
+// Timer Error Networking
+- (void)startTimerErrorNetworking;
 
 // Login View
 - (void)openLoginView:(UIViewController *)viewController delegate:(id)delegate loginType:(NSInteger)loginType selector:(NSInteger)selector;

+ 7 - 6
iOSClient/AppDelegate.m

@@ -200,7 +200,7 @@ PKPushRegistry *pushRegistry;
     // Start Timer
     self.timerProcessAutoDownloadUpload = [NSTimer scheduledTimerWithTimeInterval:k_timerProcessAutoDownloadUpload target:self selector:@selector(loadAutoDownloadUpload) userInfo:nil repeats:YES];
     self.timerUpdateApplicationIconBadgeNumber = [NSTimer scheduledTimerWithTimeInterval:k_timerUpdateApplicationIconBadgeNumber target:self selector:@selector(updateApplicationIconBadgeNumber) userInfo:nil repeats:YES];
-    [self startTimerServerUnauthorized];
+    [self startTimerErrorNetworking];
 
     // Fabric
     if (![CCUtility getDisableCrashservice]) {
@@ -312,15 +312,16 @@ PKPushRegistry *pushRegistry;
 }
 
 #pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Login / checkPassword: ServerUnauthorized =====
+#pragma mark ===== Login / checkErrorNetworking =====
 #pragma --------------------------------------------------------------------------------------------
 
-- (void)checkPassword
+- (void)checkErrorNetworking
 {
     // test
     if (self.activeAccount.length == 0 || self.maintenanceMode)
         return;
     
+    // check unauthorized server (401)
     if ([CCUtility getPassword:self.activeAccount].length == 0) {
         [self openLoginView:self.window.rootViewController delegate:self loginType:k_login_Modify_Password selector:k_intro_login];
     }
@@ -411,12 +412,12 @@ PKPushRegistry *pushRegistry;
 }
 - (void)webDismiss
 {
-    [self startTimerServerUnauthorized];
+    [self startTimerErrorNetworking];
 }
 
-- (void)startTimerServerUnauthorized
+- (void)startTimerErrorNetworking
 {
-    self.timerServerUnauthorized = [NSTimer scheduledTimerWithTimeInterval:k_timerServerUnauthorized target:self selector:@selector(checkPassword) userInfo:nil repeats:YES];
+    self.timerErrorNetworking = [NSTimer scheduledTimerWithTimeInterval:k_timerErrorNetworking target:self selector:@selector(checkErrorNetworking) userInfo:nil repeats:YES];
 }
 
 #pragma --------------------------------------------------------------------------------------------

+ 1 - 1
iOSClient/CCGlobal.h

@@ -171,7 +171,7 @@
 // Timer
 #define k_timerProcessAutoDownloadUpload                5
 #define k_timerUpdateApplicationIconBadgeNumber         3
-#define k_timerServerUnauthorized                       3
+#define k_timerErrorNetworking                          3
 
 // ConcurrentOperation
 #define k_maxHTTPConnectionsPerHost                     5

+ 2 - 2
iOSClient/Login/CCLogin.m

@@ -139,7 +139,7 @@
     [super viewDidAppear:animated];
     
     // Stop timer
-    [appDelegate.timerServerUnauthorized invalidate];
+    [appDelegate.timerErrorNetworking invalidate];
 }
 
 //
@@ -148,7 +148,7 @@
     [super viewDidDisappear:animated];
     
     // Start timer
-    [appDelegate startTimerServerUnauthorized];
+    [appDelegate startTimerErrorNetworking];
 }
 
 - (BOOL)textFieldShouldReturn:(UITextField *)textField

+ 1 - 1
iOSClient/Login/CCLoginWeb.swift

@@ -57,7 +57,7 @@ public class CCLoginWeb: UIViewController {
 
         vc.present(webVC, animated: false) {
             // Stop timer
-            self.appDelegate.timerServerUnauthorized.invalidate()
+            self.appDelegate.timerErrorNetworking.invalidate()
         }
     }
 }