浏览代码

clear code

Marino Faggiana 7 年之前
父节点
当前提交
bb04cc2711
共有 2 个文件被更改,包括 22 次插入19 次删除
  1. 21 17
      iOSClient/AppDelegate.m
  2. 1 2
      iOSClient/CCGlobal.h

+ 21 - 17
iOSClient/AppDelegate.m

@@ -708,22 +708,28 @@
         
         if (visible) {
             
-            if (errorcode == kCFURLErrorNotConnectedToInternet || errorcode == k_CCErrorNetworkNowAvailable) {
-                
-                if (errorCodePrev != errorcode)
-                    [JDStatusBarNotification showWithStatus:NSLocalizedString(@"_network_available_", nil) dismissAfter:delay styleName:JDStatusBarStyleDefault];
-                
-                errorCodePrev = errorcode;
-                
-            } else {
-                
-                if (description.length > 0) {
-                
-                    [TWMessageBarManager sharedInstance].styleSheet = self;
-                    [[TWMessageBarManager sharedInstance] showMessageWithTitle:[NSString stringWithFormat:@"%@\n", NSLocalizedString(title, nil)] description:NSLocalizedString(description, nil) type:type duration:delay];
-                }
+            switch (errorcode) {
+                    
+                // JDStatusBarNotification
+                case kCFURLErrorNotConnectedToInternet :
+                    
+                    if (errorCodePrev != errorcode)
+                        [JDStatusBarNotification showWithStatus:NSLocalizedString(title, nil) dismissAfter:delay styleName:JDStatusBarStyleDefault];
+                    
+                    errorCodePrev = errorcode;
+                    break;
+                    
+                // TWMessageBarManager
+                default:
+                    
+                    if (description.length > 0) {
+                        
+                        [TWMessageBarManager sharedInstance].styleSheet = self;
+                        [[TWMessageBarManager sharedInstance] showMessageWithTitle:[NSString stringWithFormat:@"%@\n", NSLocalizedString(title, nil)] description:NSLocalizedString(description, nil) type:type duration:delay];
+                    }
+                    break;
             }
-            
+                        
         } else {
             
             [[TWMessageBarManager sharedInstance] hideAllAnimated:YES];
@@ -1175,8 +1181,6 @@
         
         if (self.lastReachability == NO) {
             
-            [self messageNotification:@"_network_available_" description:nil visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeInfo errorCode:k_CCErrorNetworkNowAvailable];
-            
             NSLog(@"[LOG] Request Service Server Nextcloud");
             [[NCService sharedInstance] startRequestServicesServer];
         }

+ 1 - 2
iOSClient/CCGlobal.h

@@ -141,8 +141,7 @@ extern NSString *const flowEndpoint;
 #define k_CCErrorTaskDownloadNotFound                   -9998
 #define k_CCErrorUserNotAvailble                        -9997
 #define k_CCErrorInternalError                          -9996
-#define k_CCErrorNetworkNowAvailable                    -9995
-#define k_CCErrorFileAlreadyInDownload                  -9994
+#define k_CCErrorFileAlreadyInDownload                  -9995
 
 // Search
 #define k_minCharsSearch                                2