Browse Source

test

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 years ago
parent
commit
c939a4970e
1 changed files with 6 additions and 4 deletions
  1. 6 4
      iOSClient/Main/NCFunctionCenter.swift

+ 6 - 4
iOSClient/Main/NCFunctionCenter.swift

@@ -458,11 +458,13 @@ import Photos
 
         var topNavigationController: UINavigationController?
         var pushServerUrl = NCUtilityFileSystem.shared.getHomeServer(account: appDelegate.account)
+        var mostViewController = UIApplication.shared.keyWindow!.rootViewController!.topMostViewController()
 
-        let mostViewController = UIApplication.shared.keyWindow!.rootViewController!.topMostViewController()
-        let isPresented = mostViewController.presentedViewController
-
-        appDelegate.activeViewController?.navigationController?.popToRootViewController(animated: false)
+        if mostViewController.isModal {
+            mostViewController.dismiss(animated: false)
+            mostViewController = UIApplication.shared.keyWindow!.rootViewController!.topMostViewController()
+        }
+        mostViewController.navigationController?.popToRootViewController(animated: false)
         
         if let tabBarController = appDelegate.window?.rootViewController as? UITabBarController {
             tabBarController.selectedIndex = 0