Skip to content

Commit

Permalink
fix geolocation propmt when location permission not granted (#1946)
Browse files Browse the repository at this point in the history
  • Loading branch information
mallexxx authored Dec 11, 2023
1 parent 94d65bd commit 01a3a13
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions DuckDuckGo/Geolocation/GeolocationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ final class GeolocationService: NSObject, GeolocationServiceProtocol {
assert(geolocationSubscriptionCounter >= 0)
switch (oldValue, geolocationSubscriptionCounter) {
case (0, 1):
if case .notDetermined = authorizationStatus {
locationManager.requestWhenInUseAuthorization()
}
locationManager.startUpdatingLocation()
case (1, 0):
locationManager.stopUpdatingLocation()
Expand Down

0 comments on commit 01a3a13

Please sign in to comment.