From 1b444565e6580a2db6e5a859b18bac7c3f62004f Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Fri, 17 Feb 2017 15:13:46 +0300 Subject: [PATCH] [MAPSME-3877] [ios] Fixed my position mode on first launch. --- iphone/Maps/Classes/MapViewController.mm | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index e679600e2d..68b77d29d5 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -405,19 +405,24 @@ BOOL gIsFirstMyPositionMode = YES; case location::NotFollowNoPosition: { BOOL const hasLocation = [MWMLocationManager lastLocation] != nil; - if (hasLocation || (gIsFirstMyPositionMode && ![Alohalytics isFirstSession])) + if (hasLocation) { GetFramework().SwitchMyPositionNextMode(); + break; } - else + if ([Alohalytics isFirstSession]) + break; + if (gIsFirstMyPositionMode) { - BOOL const isMapVisible = (self.navigationController.visibleViewController == self); - if (isMapVisible && ![MWMLocationManager isLocationProhibited]) - { - [self.alertController presentLocationNotFoundAlertWithOkBlock:^{ - GetFramework().SwitchMyPositionNextMode(); - }]; - } + GetFramework().SwitchMyPositionNextMode(); + break; + } + BOOL const isMapVisible = (self.navigationController.visibleViewController == self); + if (isMapVisible && ![MWMLocationManager isLocationProhibited]) + { + [self.alertController presentLocationNotFoundAlertWithOkBlock:^{ + GetFramework().SwitchMyPositionNextMode(); + }]; } break; }