mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-21 13:53:37 +00:00
[ios] Fix Define Roads to Avoid button
Fixes #1670 Signed-off-by: Matheus Gomes <matheusgomesms@noreply.codeberg.org>
This commit is contained in:
committed by
Yannik Bloscheck
parent
165e844308
commit
e117be1816
@@ -117,10 +117,18 @@ NSString *const kNavigationControlViewXibName = @"NavigationControlView";
|
|||||||
- (void)onRouteReady:(BOOL)hasWarnings {
|
- (void)onRouteReady:(BOOL)hasWarnings {
|
||||||
if (self.state != MWMNavigationDashboardStateNavigation)
|
if (self.state != MWMNavigationDashboardStateNavigation)
|
||||||
self.state = MWMNavigationDashboardStateReady;
|
self.state = MWMNavigationDashboardStateReady;
|
||||||
|
|
||||||
|
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 {
|
||||||
|
// For all other modes (Vehicle, Pedestrian, Bicycle), show the button.
|
||||||
if ([MWMRouter hasActiveDrivingOptions]) {
|
if ([MWMRouter hasActiveDrivingOptions]) {
|
||||||
self.routePreview.drivingOptionsState = MWMDrivingOptionsStateChange;
|
self.routePreview.drivingOptionsState = MWMDrivingOptionsStateChange;
|
||||||
} else {
|
} else {
|
||||||
self.routePreview.drivingOptionsState = hasWarnings ? MWMDrivingOptionsStateDefine : MWMDrivingOptionsStateNone;
|
self.routePreview.drivingOptionsState = MWMDrivingOptionsStateDefine;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user