Переглянути джерело

improvements error server unauth

marinofaggiana 5 роки тому
батько
коміт
c7709dcea0

+ 18 - 1
iOSClient/AppDelegate.m

@@ -34,7 +34,7 @@
 #import "NCAutoUpload.h"
 #import "NCPushNotificationEncryption.h"
 
-@interface AppDelegate () <UNUserNotificationCenterDelegate>
+@interface AppDelegate () <UNUserNotificationCenterDelegate, CCLoginDelegate, CCLoginDelegateWeb>
 {
 PKPushRegistry *pushRegistry;
 }
@@ -343,6 +343,7 @@ PKPushRegistry *pushRegistry;
                 _activeLoginWeb.urlBase = [[NCBrandOptions sharedInstance] loginBaseUrl];
                 
                 dispatch_async(dispatch_get_main_queue(), ^ {
+                    [_timerServerUnauthorized invalidate];
                     [_activeLoginWeb open:viewController];
                 });
             }
@@ -374,6 +375,7 @@ PKPushRegistry *pushRegistry;
                 }
 
                 dispatch_async(dispatch_get_main_queue(), ^ {
+                    [_timerServerUnauthorized invalidate];
                     [_activeLoginWeb open:viewController];
                 });
             }
@@ -386,6 +388,7 @@ PKPushRegistry *pushRegistry;
             _activeLoginWeb.urlBase = [[NCBrandOptions sharedInstance] loginBaseUrl];
             
             dispatch_async(dispatch_get_main_queue(), ^ {
+                [_timerServerUnauthorized invalidate];
                 [_activeLoginWeb open:viewController];
             });
             
@@ -398,6 +401,7 @@ PKPushRegistry *pushRegistry;
                 _activeLogin.loginType = loginType;
                 
                 dispatch_async(dispatch_get_main_queue(), ^ {
+                    [_timerServerUnauthorized invalidate];
                     [viewController presentViewController:_activeLogin animated:YES completion:nil];
                 });
             }
@@ -405,6 +409,19 @@ PKPushRegistry *pushRegistry;
     }
 }
 
+- (void)loginSuccess:(NSInteger)loginType
+{
+    self.timerServerUnauthorized = [NSTimer scheduledTimerWithTimeInterval:k_timerServerUnauthorized target:self selector:@selector(checkPassword) userInfo:nil repeats:YES];
+}
+- (void)webDismiss
+{
+    self.timerServerUnauthorized = [NSTimer scheduledTimerWithTimeInterval:k_timerServerUnauthorized target:self selector:@selector(checkPassword) userInfo:nil repeats:YES];
+}
+- (void)loginDismiss
+{
+    self.timerServerUnauthorized = [NSTimer scheduledTimerWithTimeInterval:k_timerServerUnauthorized target:self selector:@selector(checkPassword) userInfo:nil repeats:YES];
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Setting Active Account for all APP =====
 #pragma --------------------------------------------------------------------------------------------

+ 2 - 1
iOSClient/Login/CCLogin.h

@@ -32,7 +32,8 @@
 
 @protocol CCLoginDelegate <NSObject>
 
-- (void) loginSuccess:(NSInteger)loginType;
+- (void)loginSuccess:(NSInteger)loginType;
+- (void)loginDismiss;
 
 @end
 

+ 1 - 0
iOSClient/Login/CCLogin.m

@@ -398,6 +398,7 @@
 
 - (IBAction)handleAnnulla:(id)sender
 {
+    [self.delegate loginDismiss];
     [self dismissViewControllerAnimated:YES completion:nil];
 }
 

+ 5 - 0
iOSClient/Main/CCMain.m

@@ -921,6 +921,11 @@
     });    
 }
 
+- (void)loginDismiss
+{
+    //
+}
+
 #pragma mark -
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Peek & Pop  =====

+ 4 - 0
iOSClient/Main/CCMore.swift

@@ -476,6 +476,10 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource, CCLo
         
         appDelegate.selectedTabBarController(Int(k_tabBarApplicationIndexFile))        
     }
+    
+    func loginDismiss() {
+        //
+    }
 }
 
 extension CCMore: SwiftModalWebVCDelegate, SwiftWebVCDelegate{

+ 6 - 1
iOSClient/Main/CCSplit.m

@@ -181,7 +181,12 @@
 
 - (void)loginSuccess:(NSInteger)loginType
 {
-    [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"initializeMain" object:nil userInfo:nil];    
+    [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"initializeMain" object:nil userInfo:nil];
+}
+
+- (void)loginDismiss
+{
+    //
 }
 
 #pragma --------------------------------------------------------------------------------------------

+ 5 - 0
iOSClient/Settings/CCManageAccount.m

@@ -367,6 +367,11 @@
     [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"initializeMain" object:nil userInfo:nil];
 }
 
+- (void)loginDismiss
+{
+    
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark === Add Account ===
 #pragma --------------------------------------------------------------------------------------------