[MAPSME-3877] [ios] Fixed my position mode on first launch.

This commit is contained in:
Ilya Grechuhin 2017-02-17 15:13:46 +03:00 committed by Sergey Yershov
parent 7db6ee4725
commit 1b444565e6

View file

@ -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;
}