From e117be1816516887a667ac22a341c013f24a227e Mon Sep 17 00:00:00 2001 From: Matheus Gomes Date: Fri, 29 Aug 2025 16:44:14 +0200 Subject: [PATCH] [ios] Fix Define Roads to Avoid button Fixes #1670 Signed-off-by: Matheus Gomes --- .../MWMNavigationDashboardManager.mm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm index 6bf6a0567..a7a4be5c0 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm @@ -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; + } } }