summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2023-05-17 16:40:11 +0200
committerAndrej Mihajlov <and@mullvad.net>2023-05-30 11:16:01 +0200
commitf6e5bdc685aa6a1e5a826bdd2cc91a7f089e0ea2 (patch)
tree09880467d367e01963fefe28bab8b152011ca33d
parentd5aa9f60fc8b396e08e1ac676a3b4c845c728dcd (diff)
downloadmullvadvpn-f6e5bdc685aa6a1e5a826bdd2cc91a7f089e0ea2.tar.xz
mullvadvpn-f6e5bdc685aa6a1e5a826bdd2cc91a7f089e0ea2.zip
Settings: filter repeating routes in navigation controller delegate
-rw-r--r--ios/MullvadVPN/Coordinators/App/SettingsCoordinator.swift7
1 files changed, 6 insertions, 1 deletions
diff --git a/ios/MullvadVPN/Coordinators/App/SettingsCoordinator.swift b/ios/MullvadVPN/Coordinators/App/SettingsCoordinator.swift
index 5bfaaa505e..34e8c90450 100644
--- a/ios/MullvadVPN/Coordinators/App/SettingsCoordinator.swift
+++ b/ios/MullvadVPN/Coordinators/App/SettingsCoordinator.swift
@@ -117,7 +117,12 @@ final class SettingsCoordinator: Coordinator, Presentable, Presenting, SettingsV
willShow viewController: UIViewController,
animated: Bool
) {
- guard let route = route(for: viewController) else { return }
+ /*
+ Navigation controller tends to call this delegate method on `viewWillAppear`, for instance during cancellation
+ of interactive dismissal of a modally presented settings navigation controller, so it's important that we
+ ignore repeating routes.
+ */
+ guard let route = route(for: viewController), currentRoute != route else { return }
logger.debug(
"Navigate from \(currentRoute.map { "\($0)" } ?? "none") -> \(route)"