marinofaggiana 4 年之前
父节点
当前提交
7d2b557896
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      iOSClient/Media/NCMedia.swift

+ 5 - 3
iOSClient/Media/NCMedia.swift

@@ -71,6 +71,8 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
         super.init(coder: aDecoder)
 
         appDelegate.activeMedia = self
+        
+        NotificationCenter.default.addObserver(self, selector: #selector(reloadDataSource), name: NSNotification.Name(rawValue: k_notificationCenter_initializeMain), object: nil)
     }
     
     override func viewDidLoad() {
@@ -133,8 +135,7 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
         mediaCommandView!.heightAnchor.constraint(equalToConstant: 150).isActive = true
         mediaCommandView!.isHidden = true
         
-        reloadDataSource()
-        
+        collectionView.reloadData()
         changeTheming()
     }
     
@@ -192,6 +193,7 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
         
         // Title
         self.navigationItem.title = NSLocalizedString("_media_", comment: "")
+        mediaCommandTitle()
     }
     
     override func viewDidAppear(_ animated: Bool) {
@@ -599,7 +601,7 @@ extension NCMedia: UICollectionViewDelegateFlowLayout {
 
 extension NCMedia {
 
-    public func reloadDataSource() {
+    @objc func reloadDataSource() {
         
         if (appDelegate.activeAccount == nil || appDelegate.activeAccount.count == 0 || appDelegate.maintenanceMode == true) {
             return