marinofaggiana 4 years ago
parent
commit
944794aca6
1 changed files with 9 additions and 1 deletions
  1. 9 1
      iOSClient/Media/NCMedia.swift

+ 9 - 1
iOSClient/Media/NCMedia.swift

@@ -64,7 +64,7 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
         appDelegate.activeMedia = self
         
         NotificationCenter.default.addObserver(self, selector: #selector(reloadDataSource), name: NSNotification.Name(rawValue: k_notificationCenter_initializeMain), object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(searchNewPhotoVideo), name: NSNotification.Name(rawValue: k_notificationCenter_applicationWillEnterForeground), object: nil)
+        NotificationCenter.default.addObserver(self, selector: #selector(applicationWillEnterForeground), name: NSNotification.Name(rawValue: k_notificationCenter_applicationWillEnterForeground), object: nil)
     }
     
     override func viewDidLoad() {
@@ -136,6 +136,14 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
         return .lightContent
     }
     
+    //MARK: - Notification
+    
+    @objc func applicationWillEnterForeground() {
+        if self.view.window == nil {
+            self.viewDidAppear(false)
+        }
+    }
+    
     //MARK: - Command
     
     func mediaCommandTitle() {