Skip to content

Commit

Permalink
Fixed a possibly not-updating StepsViewController after reroutes (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kried authored Sep 5, 2024
1 parent d3321aa commit b735475
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
* Added handling `RouteResponse.refreshTTL` into account when refreshing a route. Now it will no longer be possible to attmept to refresh and outdated route, and `Router` will inform that current route has expired using `RouterDelegate.routerDidFailToRefreshExpiredRoute(:_)` method. ([#4672](https://github.com/mapbox/mapbox-navigation-ios/pull/4672))

### Other changes
* Fixed next banner view correctly appearing when steps list view is exapnded. ([#4708](https://github.com/mapbox/mapbox-navigation-ios/pull/4708))
* Fixed next banner view correctly appearing when steps list view is expanded. ([#4708](https://github.com/mapbox/mapbox-navigation-ios/pull/4708))
* Fixed rare route simulation issue where user's speed was calculated and NaN and the puck did not move. ([#4708](https://github.com/mapbox/mapbox-navigation-ios/pull/4708))
* Fixed a possibly not-updating `StepsViewController` after reroutes when using a custom top bar.

## v2.18.4

Expand Down
8 changes: 8 additions & 0 deletions Sources/MapboxNavigation/StepsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ public class StepsViewController: UIViewController {
}

@objc func progressDidChange(_ notification: Notification) {
let key = RouteController.NotificationUserInfoKey.routeProgressKey
if let newProgress = notification.userInfo?[key] as? RouteProgress,
routeProgress.route != newProgress.route {
routeProgress = newProgress
previousLegIndex = NSNotFound
previousStepIndex = NSNotFound

}
if rebuildDataSourceIfNecessary() {
tableView.reloadData()
}
Expand Down

0 comments on commit b735475

Please sign in to comment.