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)
|
var request = URLRequest(url: url)
|
||||||
request.httpBody = data
|
request.httpBody = data
|
||||||
request.httpMethod = "POST"
|
request.httpMethod = "POST"
|
||||||
|
request.timeoutInterval = 10
|
||||||
return await requestAndDecode(request)
|
return await requestAndDecode(request)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,23 +54,19 @@ struct HistoryListItem: View {
|
|||||||
HStack {
|
HStack {
|
||||||
if let roundTripText {
|
if let roundTripText {
|
||||||
Image(systemSymbol: entry.usedLocalConnection ? .wifi : .network)
|
Image(systemSymbol: entry.usedLocalConnection ? .wifi : .network)
|
||||||
//Image(systemSymbol: .arrowUpArrowDownCircle)
|
|
||||||
Text(roundTripText)
|
Text(roundTripText)
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
}
|
}
|
||||||
//Spacer()
|
|
||||||
Image(systemSymbol: .personalhotspot)
|
Image(systemSymbol: .personalhotspot)
|
||||||
Text(counterText)
|
Text(counterText)
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
if let timeOffsetText {
|
if let timeOffsetText {
|
||||||
//Spacer()
|
|
||||||
Image(systemSymbol: .stopwatch)
|
Image(systemSymbol: .stopwatch)
|
||||||
Text(timeOffsetText)
|
Text(timeOffsetText)
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
}
|
}
|
||||||
}.foregroundColor(.secondary)
|
}.foregroundColor(.secondary)
|
||||||
}
|
}
|
||||||
//.padding()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user