From a9a2e1d6d8ee277304a5b3cf4f9476a360ba2552 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Fri, 29 Jan 2016 15:44:05 +0300 Subject: [PATCH] [ios] Fixed cross-mwm routing + migration case handling. --- 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 0f8ba1fa6c..6ab40f3fa9 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -608,7 +608,15 @@ NSString * const kAuthorizationSegue = @"Map2AuthorizationSegue"; { dispatch_async(dispatch_get_main_queue(), [=] { - [self processRoutingBuildingEvent:code countries:absentCountries routes:absentRoutes]; + if (code != routing::IRouter::ResultCode::NoError && platform::migrate::NeedMigrate()) + { + [self.controlsManager routingHidden]; + [self checkMigrationAndCallBlock:^{}]; + } + else + { + [self processRoutingBuildingEvent:code countries:absentCountries routes:absentRoutes]; + } }); }); @@ -687,14 +695,11 @@ NSString * const kAuthorizationSegue = @"Map2AuthorizationSegue"; [self.controlsManager handleRoutingError]; [self presentDownloaderAlert:code countries:absentCountries routes:absentRoutes block:[=] { - [self checkMigrationAndCallBlock:[=] - { - auto & a = GetFramework().GetCountryTree().GetActiveMapLayout(); - for (auto const & index : absentCountries) - a.DownloadMap(index, MapOptions::MapWithCarRouting); - for (auto const & index : absentRoutes) - a.DownloadMap(index, MapOptions::CarRouting); - }]; + auto & a = GetFramework().GetCountryTree().GetActiveMapLayout(); + for (auto const & index : absentCountries) + a.DownloadMap(index, MapOptions::MapWithCarRouting); + for (auto const & index : absentRoutes) + a.DownloadMap(index, MapOptions::CarRouting); }]; self.forceRoutingStateChange = ForceRoutingStateChangeNone; break;