From bacde47c42bbd798a1638b15e1de3d875eb308da Mon Sep 17 00:00:00 2001 From: Aleksey Belouosv Date: Wed, 3 Oct 2018 16:36:30 +0300 Subject: [PATCH] [iOS] don't show tips'n'tricks when in routing mode --- .../MapViewControls/MWMMapViewControlsManager.mm | 3 +++ iphone/Maps/Core/Routing/MWMRouter.h | 1 + iphone/Maps/Core/Routing/MWMRouter.mm | 7 ++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm index e4fbb70941..03810c4eac 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm @@ -405,6 +405,9 @@ extern NSString * const kAlohalyticsTapEventKey; - (void)showTutorialIfNeeded { + if ([MWMRouter isRoutingActive] || [MWMRouter hasSavedRoute]) + return; + self.tutorialType = [MWMEye getTipType]; auto tutorial = [self tutorialWithType:self.tutorialType]; if (!tutorial) diff --git a/iphone/Maps/Core/Routing/MWMRouter.h b/iphone/Maps/Core/Routing/MWMRouter.h index 451a070601..793a05e3f8 100644 --- a/iphone/Maps/Core/Routing/MWMRouter.h +++ b/iphone/Maps/Core/Routing/MWMRouter.h @@ -52,6 +52,7 @@ typedef void (^MWMImageHeightBlock)(UIImage *, NSString *); + (void)saveRouteIfNeeded; + (void)restoreRouteIfNeeded; ++ (BOOL)hasSavedRoute; @end diff --git a/iphone/Maps/Core/Routing/MWMRouter.mm b/iphone/Maps/Core/Routing/MWMRouter.mm index 5472867f0e..dd7de7f941 100644 --- a/iphone/Maps/Core/Routing/MWMRouter.mm +++ b/iphone/Maps/Core/Routing/MWMRouter.mm @@ -738,7 +738,7 @@ void logPointEvent(MWMRoutePoint * point, NSString * eventType) if ([MapsAppDelegate theApp].isDrapeEngineCreated) { auto & rm = GetFramework().GetRoutingManager(); - if ([self isRoutingActive] || !rm.HasSavedRoutePoints()) + if ([self isRoutingActive] || ![self hasSavedRoute]) return; rm.LoadRoutePoints([self](bool success) { @@ -754,4 +754,9 @@ void logPointEvent(MWMRoutePoint * point, NSString * eventType) } } ++ (BOOL)hasSavedRoute +{ + return GetFramework().GetRoutingManager().HasSavedRoutePoints(); +} + @end