Skip to content

Commit

Permalink
Always fire alertLevelDidChange after incrementing step (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobby Sudekum committed Jul 25, 2017
1 parent 1f2ac20 commit 1840f48
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions MapboxCoreNavigation/RouteController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@ extension RouteController: CLLocationManagerDelegate {
}

func incrementRouteProgress(_ newlyCalculatedAlertLevel: AlertLevel, location: CLLocation, updateStepIndex: Bool) {

if updateStepIndex {
routeProgress.currentLegProgress.stepIndex += 1
}
Expand All @@ -504,7 +503,7 @@ extension RouteController: CLLocationManagerDelegate {
return
}

if routeProgress.currentLegProgress.alertUserLevel != newlyCalculatedAlertLevel {
if routeProgress.currentLegProgress.alertUserLevel != newlyCalculatedAlertLevel || updateStepIndex {
routeProgress.currentLegProgress.alertUserLevel = newlyCalculatedAlertLevel
// Use fresh user location distance to end of step
// since the step could of changed
Expand Down

0 comments on commit 1840f48

Please sign in to comment.