优化首页位置上报体验

This commit is contained in:
2026-07-10 11:44:56 +08:00
parent c03a625409
commit df547a16dc
8 changed files with 47 additions and 11 deletions

View File

@ -13,9 +13,11 @@ final class MockLocationProvider: LocationProviding, @unchecked Sendable {
var reverseGeocodeResult = "北京市东城区"
var requestSnapshotError: Error?
var requestCoordinateError: Error?
var requestedSnapshotAccuracies: [CLLocationAccuracy] = []
var requestedAccuracies: [CLLocationAccuracy] = []
func requestSnapshot() async throws -> HomeLocationSnapshot {
func requestSnapshot(desiredAccuracy: CLLocationAccuracy = kCLLocationAccuracyBest) async throws -> HomeLocationSnapshot {
requestedSnapshotAccuracies.append(desiredAccuracy)
if let requestSnapshotError { throw requestSnapshotError }
return snapshot
}