Commit 840a9fcf by Demid Merzlyakov

Fix missing privacy notice in some cases.

parent 2b92823c
......@@ -23,7 +23,7 @@ class MenuViewController: UIViewController {
super.init(nibName: nil, bundle: nil)
self.viewModel.delegate = self
if #available(iOS 13.0, *) {
NotificationCenter.default.addObserver(self, selector: #selector(appWillEnterBackgroundHandler), name: UIScene.willDeactivateNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(appWillEnterBackgroundHandler), name: UIScene.didEnterBackgroundNotification, object: nil)
} else {
NotificationCenter.default.addObserver(self, selector: #selector(appWillEnterBackgroundHandler), name: UIApplication.willResignActiveNotification, object: nil)
}
......
......@@ -29,16 +29,24 @@ class OnboardingViewController: UIViewController {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
closing = false
promptForLocationAccess()
}
var closing = false
private func close(animated: Bool) {
guard !closing else {
return
}
closing = true
self.presentingViewController?.dismiss(animated: animated, completion: { [weak self] in
guard let self = self else { return }
self.coordinator.viewControllerDidEnd(controller: self)
})
}
private func promptForLocationAccess() {
locationManager.useCurrentLocation(presentDialogsIn: self) { [weak self] (result) in
guard let self = self else { return }
......@@ -69,6 +77,7 @@ extension OnboardingViewController: LocationManagerDelegate {
func locationManager(_ locationManager: LocationManager, updatedLocationsList newList: [Location]) {
if newList.count > 0 {
close(animated: true)
locationManager.remove(delegate: self)
}
}
}
......@@ -27,6 +27,7 @@ class TodayViewController: UIViewController {
init(coordinator:TodayCoordinator) {
self.coordinator = coordinator
super.init(nibName: nil, bundle: nil)
self.coordinator.delegate = self
}
@available(*, unavailable)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment