Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 7127cfe

Browse files
friedbunnyincanus
authored andcommitted
Fix build, only ask for location permission on user's instigation
Previously in #2265 we would ask for location permission at app startup if `!settings->showsUserLocation`. #2193 0a172a2 changed the way we used `NSUserDefaults` and mostly removed the `settings` object, which broke #2265. Rather than fix our pestering location permissions ask at startup, this commit now only asks for location permissions when the user hits the locate-me button. Once a user grants permission, the user dot appears because a `userTrackingMode` is set, `showsUserLocation` is permanently set to `YES` in `NSUserDefaults` and is restored at launch.
1 parent a9ef04e commit 7127cfe

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

ios/app/MBXViewController.mm

-7
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,6 @@ - (void)viewDidLoad
8383
action:@selector(locateUser)];
8484

8585
[self restoreState:nil];
86-
87-
if ( ! settings->showsUserLocation)
88-
{
89-
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
90-
self.mapView.showsUserLocation = YES;
91-
});
92-
}
9386
}
9487

9588
- (void)saveState:(__unused NSNotification *)notification

0 commit comments

Comments
 (0)