Skip to content

Commit

Permalink
iOS: Disable navigation when not visible
Browse files Browse the repository at this point in the history
  • Loading branch information
YoussefHenna committed Sep 9, 2024
1 parent 88b760b commit 743bb9c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ios/ExpoMapboxNavigationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ class ExpoMapboxNavigationViewController: UIViewController {
sessionCancellable?.cancel()
}

override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
Task { @MainActor in tripSession?.setToIdle() } // Stops navigation
}

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
fatalError("This controller should not be loaded through a story board")
Expand Down

0 comments on commit 743bb9c

Please sign in to comment.