Skip to content

Commit a775d36

Browse files
authored
Do not send willReroute notification if a reroute is already in progress (#3772)
* Do not send willReroute notification if a reroute is already in progress * Add changelog
1 parent 24b4090 commit a775d36

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* Fixed a crash starting turn-by-turn navigation on some routes that included bridges and restricted-access roads. ([#3765](https://github.com/mapbox/mapbox-navigation-ios/pull/3765))
2626
* Fixed an issue where the route line appeared to begin away from the user’s current location after the route was refreshed. ([#3781](https://github.com/mapbox/mapbox-navigation-ios/pull/3781))
2727
* Fixed a memory leak after ending a turn-by-turn navigation session. ([#3782](https://github.com/mapbox/mapbox-navigation-ios/pull/3782))
28+
* Fixed an issue where `RouteControllerWillReroute` notification was incorrectly sent when a reroute was already in progress. ([#3772](https://github.com/mapbox/mapbox-navigation-ios/pull/3772))
2829
* Fixed an issue when `SimulatedLocationManager` could freeze the main thread when working with long routes. The manager now calls delegate methods from a background thread. ([#3672](https://github.com/mapbox/mapbox-navigation-ios/pull/3672))
2930
* Fixed an issue where initial puck position can be incorrect when `NavigationViewController` is presented. ([#3773](https://github.com/mapbox/mapbox-navigation-ios/pull/3773))
3031

Sources/MapboxCoreNavigation/RouteController.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -684,14 +684,13 @@ extension RouteController: Router {
684684
}
685685
}
686686

687-
announceImpendingReroute(at: location)
688-
689-
self.lastRerouteLocation = location
690-
691687
// Avoid interrupting an ongoing reroute
692688
if isRerouting { return }
693689
isRerouting = true
694-
690+
691+
announceImpendingReroute(at: location)
692+
self.lastRerouteLocation = location
693+
695694
calculateRoutes(from: location, along: progress) { [weak self] (session, result) in
696695
guard let self = self else { return }
697696

0 commit comments

Comments
 (0)