Clean code and add network timeout

This commit is contained in:
Christoph Hagen 2023-08-09 16:27:34 +02:00
parent f451715a11
commit e5ea8c4951
2 changed files with 1 additions and 4 deletions

View File

@ -40,6 +40,7 @@ final class Client {
var request = URLRequest(url: url)
request.httpBody = data
request.httpMethod = "POST"
request.timeoutInterval = 10
return await requestAndDecode(request)
}

View File

@ -54,23 +54,19 @@ struct HistoryListItem: View {
HStack {
if let roundTripText {
Image(systemSymbol: entry.usedLocalConnection ? .wifi : .network)
//Image(systemSymbol: .arrowUpArrowDownCircle)
Text(roundTripText)
.font(.subheadline)
}
//Spacer()
Image(systemSymbol: .personalhotspot)
Text(counterText)
.font(.subheadline)
if let timeOffsetText {
//Spacer()
Image(systemSymbol: .stopwatch)
Text(timeOffsetText)
.font(.subheadline)
}
}.foregroundColor(.secondary)
}
//.padding()
}
}