Merge pull request #156 from meshtastic/Bugfixes_for_1_3_39

Bugfixes for 1 3 39
This commit is contained in:
Garth Vander Houwen 2022-08-31 17:14:04 -07:00 committed by GitHub
commit 85350b873d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 28 deletions

View file

@ -213,37 +213,45 @@ struct UserMessageList: View {
let messageDate = Date(timeIntervalSince1970: TimeInterval(message.messageTimestamp))
Text("Sent \(messageDate, style: .date) \(messageDate.formattedDate(format: "h:mm:ss a"))").font(.caption2).foregroundColor(.gray)
Text("Date \(messageDate, style: .date) \(messageDate.formattedDate(format: "h:mm:ss a"))").font(.caption2).foregroundColor(.gray)
}
if message.receivedACK {
if currentUser && message.receivedACK {
VStack {
Text("Received Ack \(message.receivedACK ? "✔️" : "")")
}
}
if message.ackError > 0 {
} else if currentUser && message.ackError == 0 {
// Empty Error
Text("Waiting. . .")
} else if currentUser && message.ackError > 0 {
let ackErrorVal = RoutingError(rawValue: Int(message.ackError))
Text("\(ackErrorVal?.display ?? "No Error" )").fixedSize(horizontal: false, vertical: true)
}
VStack {
if currentUser {
let ackDate = Date(timeIntervalSince1970: TimeInterval(message.ackTimestamp))
let sixMonthsAgo = Calendar.current.date(byAdding: .month, value: -6, to: Date())
if ackDate >= sixMonthsAgo! {
VStack {
Text((ackDate.formattedDate(format: "h:mm:ss a"))).font(.caption2).foregroundColor(.gray)
let ackDate = Date(timeIntervalSince1970: TimeInterval(message.ackTimestamp))
} else {
Text("Unknown Age").font(.caption2).foregroundColor(.gray)
let sixMonthsAgo = Calendar.current.date(byAdding: .month, value: -6, to: Date())
if ackDate >= sixMonthsAgo! {
Text((ackDate.formattedDate(format: "h:mm:ss a"))).font(.caption2).foregroundColor(.gray)
} else {
Text("Unknown Age").font(.caption2).foregroundColor(.gray)
}
}
}
if message.ackSNR != 0 {
VStack {

View file

@ -107,20 +107,23 @@ struct NodeList: View {
let myCoord = CLLocation(latitude: LocationHelper.currentLocation.latitude, longitude: LocationHelper.currentLocation.longitude)
let nodeCoord = CLLocation(latitude: lastPostion.coordinate!.latitude, longitude: lastPostion.coordinate!.longitude)
let metersAway = nodeCoord.distance(from: myCoord)
Image(systemName: "lines.measurement.horizontal").font(.title3)
.foregroundColor(.accentColor).symbolRenderingMode(.hierarchical)
if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac {
if lastPostion.coordinate != nil {
let nodeCoord = CLLocation(latitude: lastPostion.coordinate!.latitude, longitude: lastPostion.coordinate!.longitude)
DistanceText(meters: metersAway).font(.subheadline).foregroundColor(.gray)
let metersAway = nodeCoord.distance(from: myCoord)
} else {
Image(systemName: "lines.measurement.horizontal").font(.title3)
.foregroundColor(.accentColor).symbolRenderingMode(.hierarchical)
DistanceText(meters: metersAway).font(.title3).foregroundColor(.gray)
if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac {
DistanceText(meters: metersAway).font(.subheadline).foregroundColor(.gray)
} else {
DistanceText(meters: metersAway).font(.title3).foregroundColor(.gray)
}
}
}
}

View file

@ -87,7 +87,7 @@ struct TelemetryLog: View {
.font(.title)
let tempReadingType = (!(node.telemetryConfig?.environmentDisplayFahrenheit ?? true)) ? "°C" : "°F"
let tempReadingType = (!(node.telemetryConfig?.environmentDisplayFahrenheit ?? false)) ? "°C" : "°F"
if tel.temperature > 0 {