gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-ios] 52/69: return to Balances after tx


From: gnunet
Subject: [taler-taler-ios] 52/69: return to Balances after tx
Date: Fri, 19 Jan 2024 09:02:25 +0100

This is an automated email from the git hooks/post-receive script.

marc-stibane pushed a commit to branch master
in repository taler-ios.

commit eaa421cfe14a078ce46b66d0cdf2ead907071ed1
Author: Marc Stibane <marc@taler.net>
AuthorDate: Thu Jan 18 00:40:17 2024 +0100

    return to Balances after tx
---
 TalerWallet1/Helper/View+dismissTop.swift | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/TalerWallet1/Helper/View+dismissTop.swift 
b/TalerWallet1/Helper/View+dismissTop.swift
index 3d11bd0..2e2a92a 100644
--- a/TalerWallet1/Helper/View+dismissTop.swift
+++ b/TalerWallet1/Helper/View+dismissTop.swift
@@ -35,12 +35,31 @@ extension View {
             if gotPresented {
                 topController.dismiss(animated: animated)
             } else {
-                print("Yikes❗️ Trying to dismiss the rootViewController!")
+                Self.findNavigationController(viewController: 
topController)?.popToRootViewController(animated: animated)
             }
         } else {
             print("Yikes❗️ There is no window/rootViewController!")
         }
     }
+    @MainActor static func findNavigationController(viewController: 
UIViewController?) -> UINavigationController? {
+        guard let viewController = viewController else {
+            return nil
+        }
+
+        if let navigationController = viewController as? UITabBarController {
+            return findNavigationController(viewController: 
navigationController.selectedViewController)
+        }
+
+        if let navigationController = viewController as? 
UINavigationController {
+            return navigationController
+        }
+
+        for childViewController in viewController.children {
+            return findNavigationController(viewController: 
childViewController)
+        }
+
+        return nil
+    }
 }
 // MARK: -
 extension View {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]