marinofaggiana 6 years ago
parent
commit
d2bd9827f5
3 changed files with 13 additions and 7 deletions
  1. 3 0
      iOSClient/AppDelegate.h
  2. 8 2
      iOSClient/AppDelegate.m
  3. 2 5
      iOSClient/Main/CCSplit.m

+ 3 - 0
iOSClient/AppDelegate.h

@@ -138,6 +138,9 @@
 // UserDefaults
 @property (nonatomic, strong) NSUserDefaults *ncUserDefaults;
 
+// Timer Server Unauthorized
+- (void)startTimerServerUnauthorized;
+
 // Login View
 - (void)openLoginView:(UIViewController *)viewController delegate:(id)delegate loginType:(NSInteger)loginType selector:(NSInteger)selector;
 

+ 8 - 2
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.timerServerUnauthorized = [NSTimer scheduledTimerWithTimeInterval:k_timerServerUnauthorized target:self selector:@selector(checkPassword) userInfo:nil repeats:YES];
+    [self startTimerServerUnauthorized];
 
     // Fabric
     if (![CCUtility getDisableCrashservice]) {
@@ -411,9 +411,15 @@ PKPushRegistry *pushRegistry;
 }
 - (void)webDismiss
 {
-    self.timerServerUnauthorized = [NSTimer scheduledTimerWithTimeInterval:k_timerServerUnauthorized target:self selector:@selector(checkPassword) userInfo:nil repeats:YES];
+    [self startTimerServerUnauthorized];
 }
+
 - (void)loginDismiss
+{
+    [self startTimerServerUnauthorized];
+}
+
+- (void)startTimerServerUnauthorized
 {
     self.timerServerUnauthorized = [NSTimer scheduledTimerWithTimeInterval:k_timerServerUnauthorized target:self selector:@selector(checkPassword) userInfo:nil repeats:YES];
 }

+ 2 - 5
iOSClient/Main/CCSplit.m

@@ -181,14 +181,11 @@
 
 - (void)loginSuccess:(NSInteger)loginType
 {
+    [appDelegate startTimerServerUnauthorized];
+    
     [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"initializeMain" object:nil userInfo:nil];
 }
 
-- (void)loginDismiss
-{
-    //
-}
-
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Split View Controller =====
 #pragma --------------------------------------------------------------------------------------------