mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Add reverse geocoding service (#1085)
* add Geocoding service * move url session extension
This commit is contained in:
@@ -342,14 +342,3 @@ extension BugReportService: URLSessionTaskDelegate {
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
}
|
||||
|
||||
private extension URLSession {
|
||||
/// The same as `data(for:delegate:)` but with an additional immediate retry if the first attempt fails.
|
||||
func dataWithRetry(for request: URLRequest, delegate: URLSessionTaskDelegate? = nil) async throws -> (Data, URLResponse) {
|
||||
if let firstTryResult = try? await data(for: request, delegate: delegate) {
|
||||
return firstTryResult
|
||||
}
|
||||
|
||||
return try await data(for: request, delegate: delegate)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user