瀏覽代碼

test

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 年之前
父節點
當前提交
c939a4970e
共有 1 個文件被更改,包括 6 次插入4 次删除
  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