mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +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 {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user