Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/ios.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarinofaggiana <ios@nextcloud.com>2022-08-02 19:58:33 +0300
committermarinofaggiana <ios@nextcloud.com>2022-08-02 19:58:33 +0300
commitdf74d8cec9d247f5ef02a97ae08353e9160c579c (patch)
tree9ddc2f5dbe496722b3a8b40b9bf5a8107333789f
parentc939a4970e4c3014bfebb295651c5d786803267e (diff)
test
Signed-off-by: marinofaggiana <ios@nextcloud.com>
-rw-r--r--iOSClient/Main/NCFunctionCenter.swift74
1 files changed, 38 insertions, 36 deletions
diff --git a/iOSClient/Main/NCFunctionCenter.swift b/iOSClient/Main/NCFunctionCenter.swift
index 8ec067f86..71fbccb5d 100644
--- a/iOSClient/Main/NCFunctionCenter.swift
+++ b/iOSClient/Main/NCFunctionCenter.swift
@@ -456,50 +456,52 @@ import Photos
func openFileViewInFolder(serverUrl: String, fileNameBlink: String?) {
- var topNavigationController: UINavigationController?
- var pushServerUrl = NCUtilityFileSystem.shared.getHomeServer(account: appDelegate.account)
- var mostViewController = UIApplication.shared.keyWindow!.rootViewController!.topMostViewController()
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
+ var topNavigationController: UINavigationController?
+ var pushServerUrl = NCUtilityFileSystem.shared.getHomeServer(account: self.appDelegate.account)
+ var mostViewController = UIApplication.shared.keyWindow!.rootViewController!.topMostViewController()
+
+ if mostViewController.isModal {
+ mostViewController.dismiss(animated: false)
+ mostViewController = UIApplication.shared.keyWindow!.rootViewController!.topMostViewController()
+ }
+ mostViewController.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
- if let navigationController = tabBarController.viewControllers?.first as? UINavigationController {
- navigationController.popToRootViewController(animated: false)
- topNavigationController = navigationController
+ if let tabBarController = self.appDelegate.window?.rootViewController as? UITabBarController {
+ tabBarController.selectedIndex = 0
+ if let navigationController = tabBarController.viewControllers?.first as? UINavigationController {
+ navigationController.popToRootViewController(animated: false)
+ topNavigationController = navigationController
+ }
}
- }
- if pushServerUrl == serverUrl {
- let viewController = topNavigationController?.topViewController as? NCFiles
- viewController?.blinkCell(fileName: fileNameBlink)
- return
- }
- guard let topNavigationController = topNavigationController else { return }
+ if pushServerUrl == serverUrl {
+ let viewController = topNavigationController?.topViewController as? NCFiles
+ viewController?.blinkCell(fileName: fileNameBlink)
+ return
+ }
+ guard let topNavigationController = topNavigationController else { return }
- let diffDirectory = serverUrl.replacingOccurrences(of: pushServerUrl, with: "")
- var subDirs = diffDirectory.split(separator: "/")
+ let diffDirectory = serverUrl.replacingOccurrences(of: pushServerUrl, with: "")
+ var subDirs = diffDirectory.split(separator: "/")
- while pushServerUrl != serverUrl, subDirs.count > 0 {
+ while pushServerUrl != serverUrl, subDirs.count > 0 {
- guard let dir = subDirs.first, let viewController = UIStoryboard(name: "NCFiles", bundle: nil).instantiateInitialViewController() as? NCFiles else { return }
- pushServerUrl = pushServerUrl + "/" + dir
+ guard let dir = subDirs.first, let viewController = UIStoryboard(name: "NCFiles", bundle: nil).instantiateInitialViewController() as? NCFiles else { return }
+ pushServerUrl = pushServerUrl + "/" + dir
- viewController.serverUrl = pushServerUrl
- viewController.isRoot = false
- viewController.titleCurrentFolder = String(dir)
- if pushServerUrl == serverUrl {
- viewController.fileNameBlink = fileNameBlink
- }
- appDelegate.listFilesVC[serverUrl] = viewController
+ viewController.serverUrl = pushServerUrl
+ viewController.isRoot = false
+ viewController.titleCurrentFolder = String(dir)
+ if pushServerUrl == serverUrl {
+ viewController.fileNameBlink = fileNameBlink
+ }
+ self.appDelegate.listFilesVC[serverUrl] = viewController
- viewController.navigationItem.backButtonTitle = viewController.titleCurrentFolder
- topNavigationController.pushViewController(viewController, animated: false)
+ viewController.navigationItem.backButtonTitle = viewController.titleCurrentFolder
+ topNavigationController.pushViewController(viewController, animated: false)
- subDirs.remove(at: 0)
+ subDirs.remove(at: 0)
+ }
}
}