Clean code and add network timeout
This commit is contained in:
parent
f451715a11
commit
e5ea8c4951
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user