From aa4aef7dfe4e8ed84f605c20e810dbb52058feba Mon Sep 17 00:00:00 2001 From: Alexander Borsuk Date: Sun, 22 May 2022 00:15:51 +0200 Subject: [PATCH] [ios] Fixed double-import of KML/KMZ on a cold start Signed-off-by: Alexander Borsuk --- iphone/Maps/Classes/EAGLView.h | 1 - iphone/Maps/Classes/EAGLView.mm | 2 +- iphone/Maps/Classes/MapViewController.mm | 12 ++++-------- iphone/Maps/Classes/MapsAppDelegate.mm | 1 + 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/iphone/Maps/Classes/EAGLView.h b/iphone/Maps/Classes/EAGLView.h index c8c49cc757..e4e0dca04a 100644 --- a/iphone/Maps/Classes/EAGLView.h +++ b/iphone/Maps/Classes/EAGLView.h @@ -9,7 +9,6 @@ @property(nonatomic) MWMMapWidgets * widgetsManager; @property(nonatomic, readonly) BOOL drapeEngineCreated; -@property(nonatomic, getter=isLaunchByDeepLink) BOOL launchByDeepLink; @property(nonatomic, readonly) CGSize pixelSize; @property(nonatomic, readonly) BOOL graphicContextInitialized; diff --git a/iphone/Maps/Classes/EAGLView.mm b/iphone/Maps/Classes/EAGLView.mm index 88ba7520df..ef1450d38c 100644 --- a/iphone/Maps/Classes/EAGLView.mm +++ b/iphone/Maps/Classes/EAGLView.mm @@ -171,7 +171,7 @@ double getExactDPI(double contentScaleFactor) p.m_surfaceHeight = height; p.m_visualScale = dp::VisualScale(getExactDPI(self.contentScaleFactor)); p.m_hints.m_isFirstLaunch = [FirstSession isFirstSession]; - p.m_hints.m_isLaunchByDeepLink = self.isLaunchByDeepLink; + p.m_hints.m_isLaunchByDeepLink = DeepLinkHandler.shared.isLaunchedByDeeplink; [self.widgetsManager setupWidgets:p]; GetFramework().CreateDrapeEngine(make_ref(m_factory), std::move(p)); diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index 59cefc3d80..1c951ea190 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -317,8 +317,6 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing"; if (self.needDeferFocusNotification) [self onGetFocus:self.deferredFocusValue]; - BOOL const isLaunchedByDeeplink = DeepLinkHandler.shared.isLaunchedByDeeplink; - [self.mapView setLaunchByDeepLink:isLaunchedByDeeplink]; [MWMRouter restoreRouteIfNeeded]; self.view.clipsToBounds = YES; @@ -340,12 +338,10 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing"; if ([MWMNavigationDashboardManager sharedManager].state == MWMNavigationDashboardStateHidden) self.controlsManager.menuState = self.controlsManager.menuRestoreState; - if (isLaunchedByDeeplink) - (void)[DeepLinkHandler.shared handleDeepLink]; - else + /// @todo: Uncomment update dialog when will be ready to handle big traffic bursts. + /* + if (!DeepLinkHandler.shared.isLaunchedByDeeplink) { - /// @todo: Uncomment update dialog when will be ready to handle big traffic bursts. - /* auto const todo = GetFramework().ToDoAfterUpdate(); switch (todo) { case Framework::DoAfterUpdate::Migrate: @@ -356,8 +352,8 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing"; [self presentViewController:[MWMAutoupdateController instanceWithPurpose:todo] animated:YES completion:nil]; break; } - */ } + */ } - (void)viewDidLayoutSubviews { diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index 297c36c423..a1f199aae7 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -126,6 +126,7 @@ using namespace osm_auth_ios; [self enableTTSForTheFirstTime]; [[DeepLinkHandler shared] applicationDidFinishLaunching:launchOptions]; + // application:openUrl:options is called later for deep links if YES is returned. return YES; }