Marino Faggiana 6 years ago
parent
commit
2922bc60e6
2 changed files with 9 additions and 8 deletions
  1. 4 2
      iOSClient/Activity/NCActivity.swift
  2. 5 6
      iOSClient/Networking/NCService.swift

+ 4 - 2
iOSClient/Activity/NCActivity.swift

@@ -54,8 +54,6 @@ class NCActivity: UIViewController, UITableViewDataSource, UITableViewDelegate,
         refreshControl.tintColor = NCBrandColor.sharedInstance.brandText
         refreshControl.backgroundColor = NCBrandColor.sharedInstance.brand
         refreshControl.addTarget(self, action: #selector(loadActivityRefreshing), for: .valueChanged)
-        
-        self.title = NSLocalizedString("_activity_", comment: "")
     }
     
     override func viewWillAppear(_ animated: Bool) {
@@ -65,6 +63,8 @@ class NCActivity: UIViewController, UITableViewDataSource, UITableViewDelegate,
         appDelegate.aspectNavigationControllerBar(self.navigationController?.navigationBar, online: appDelegate.reachability.isReachable(), hidden: false)
         appDelegate.aspectTabBar(self.tabBarController?.tabBar, hidden: false)
     
+        self.title = NSLocalizedString("_activity_", comment: "")
+
         loadDataSource()
     }
     
@@ -92,6 +92,8 @@ class NCActivity: UIViewController, UITableViewDataSource, UITableViewDelegate,
 
     func loadDataSource() {
         
+        sectionDate.removeAll()
+    
         activities = NCManageDatabase.sharedInstance.getActivity(predicate: NSPredicate(format: "account == %@", appDelegate.activeAccount))
         for tableActivity in activities {
             guard let date = Calendar.current.date(from: Calendar.current.dateComponents([.year, .month, .day], from: tableActivity.date as Date)) else {

+ 5 - 6
iOSClient/Networking/NCService.swift

@@ -144,14 +144,13 @@ class NCService: NSObject {
                                 DispatchQueue.main.async {
                                     
                                     if (new != old) {
-                                        
                                         self.appDelegate.listOfNotifications = NSMutableArray.init(array: sortedListOfNotifications)
                                         NotificationCenter.default.post(name: NSNotification.Name(rawValue: "notificationReloadData"), object: nil)
-                                        
-                                        // Update Main NavigationBar
-                                        if (self.appDelegate.activeMain.isSelectedMode == false && self.appDelegate.activeMain != nil) {
-                                            self.appDelegate.activeMain.setUINavigationBarDefault()
-                                        }
+                                    }
+                                    
+                                    // Update Main NavigationBar
+                                    if (self.appDelegate.activeMain.isSelectedMode == false && self.appDelegate.activeMain != nil) {
+                                        self.appDelegate.activeMain.setUINavigationBarDefault()
                                     }
                                 }
                             }