Browse Source

clear code

Marino Faggiana 7 years ago
parent
commit
2523580eca
2 changed files with 13 additions and 16 deletions
  1. 8 11
      iOSClient/AppDelegate.m
  2. 5 5
      iOSClient/Main/CCMain.m

+ 8 - 11
iOSClient/AppDelegate.m

@@ -241,11 +241,7 @@
 // L' applicazione entrerà in primo piano (attivo solo dopo il background)
 //
 - (void)applicationWillEnterForeground:(UIApplication *)application
-{    
-    // refresh active Main
-    if (_activeMain)
-        [_activeMain readFileReloadFolder];
-    
+{
     // Initializations
     [self applicationInitialized];
 }
@@ -302,12 +298,13 @@
     // verify Upload
     [self verifyUploadInErrorOrWait];
 
-    if (_activeMain) {
-        NSLog(@"[LOG] Request Server Capabilities");
-        [_activeMain requestServerCapabilities];
-    }
-        
-    if (_activeMain && [[NCBrandOptions sharedInstance] use_middlewarePing]) {
+    NSLog(@"[LOG] Request Server Capabilities");
+    [_activeMain requestServerCapabilities];
+    
+    NSLog(@"[LOG] Refresh Active Main");
+    [_activeMain readFileReloadFolder];
+    
+    if ([[NCBrandOptions sharedInstance] use_middlewarePing]) {
         NSLog(@"[LOG] Middleware Ping");
         [_activeMain middlewarePing];
     }

+ 5 - 5
iOSClient/Main/CCMain.m

@@ -114,6 +114,9 @@
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setTitle) name:@"setTitleMain" object:nil];
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(triggerProgressTask:) name:@"NotificationProgressTask" object:nil];
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
+        
+        // Active Main
+        appDelegate.activeMain = self;
     }
     
     return self;
@@ -151,7 +154,7 @@
     self.searchController.searchBar.delegate = self;
     
     [CCNetworking sharedNetworking].delegate = self;
-        
+    
     // Custom Cell
     [self.tableView registerNib:[UINib nibWithNibName:@"CCCellMain" bundle:nil] forCellReuseIdentifier:@"CellMain"];
     [self.tableView registerNib:[UINib nibWithNibName:@"CCCellMainTransfer" bundle:nil] forCellReuseIdentifier:@"CellMainTransfer"];
@@ -362,10 +365,7 @@
             appDelegate.sharesLink = results[0];
             appDelegate.sharesUserAndGroup = results[1];
         }
-        
-        // Read (File) Folder
-        [self readFileReloadFolder];
-        
+                
         // Setting Theming
         [appDelegate settingThemingColorBrand];