[ios] Fix Define Roads to Avoid button

Fixes #1670

Signed-off-by: Matheus Gomes <matheusgomesms@noreply.codeberg.org>
This commit is contained in:
Matheus Gomes
2025-08-29 16:44:14 +02:00
committed by Yannik Bloscheck
parent 165e844308
commit e117be1816

View File

@@ -117,10 +117,18 @@ NSString *const kNavigationControlViewXibName = @"NavigationControlView";
- (void)onRouteReady:(BOOL)hasWarnings {
if (self.state != MWMNavigationDashboardStateNavigation)
self.state = MWMNavigationDashboardStateReady;
if ([MWMRouter hasActiveDrivingOptions]) {
self.routePreview.drivingOptionsState = MWMDrivingOptionsStateChange;
MWMRouterType const routerType = [MWMRouter type];
if (routerType == MWMRouterTypePublicTransport || routerType == MWMRouterTypeRuler) {
// For Public Transport and Ruler modes, there are no road restrictions, so always hide the button.
self.routePreview.drivingOptionsState = MWMDrivingOptionsStateNone;
} else {
self.routePreview.drivingOptionsState = hasWarnings ? MWMDrivingOptionsStateDefine : MWMDrivingOptionsStateNone;
// For all other modes (Vehicle, Pedestrian, Bicycle), show the button.
if ([MWMRouter hasActiveDrivingOptions]) {
self.routePreview.drivingOptionsState = MWMDrivingOptionsStateChange;
} else {
self.routePreview.drivingOptionsState = MWMDrivingOptionsStateDefine;
}
}
}