refactor: streamline node invoke handling
This commit is contained in:
1 parent
c0b248f291
commit
fd95ededaa
8 files changed
+810
-666
No files matched your search
@@ -67,7 +67,7 @@ final class LocationService: NSObject, CLLocationManagerDelegate {
|
||||
}
|
||||
|
||||
self.manager.desiredAccuracy = Self.accuracyValue(desiredAccuracy)
|
||||
let timeout = max(0, timeoutMs ?? 10_000)
|
||||
let timeout = max(0, timeoutMs ?? 10000)
|
||||
return try await self.withTimeout(timeoutMs: timeout) {
|
||||
try await self.requestLocation()
|
||||
}
|
||||
@@ -109,11 +109,11 @@ final class LocationService: NSObject, CLLocationManagerDelegate {
|
||||
private static func accuracyValue(_ accuracy: ClawdbotLocationAccuracy) -> CLLocationAccuracy {
|
||||
switch accuracy {
|
||||
case .coarse:
|
||||
return kCLLocationAccuracyKilometer
|
||||
kCLLocationAccuracyKilometer
|
||||
case .balanced:
|
||||
return kCLLocationAccuracyHundredMeters
|
||||
kCLLocationAccuracyHundredMeters
|
||||
case .precise:
|
||||
return kCLLocationAccuracyBest
|
||||
kCLLocationAccuracyBest
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user