Bug fixes

This commit is contained in:
Garth Vander Houwen 2023-02-06 10:26:04 -08:00
parent fda42ecc15
commit 9511ee76f3
4 changed files with 11 additions and 7 deletions

View file

@ -456,7 +456,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, ObservableObject {
}
}
// NodeInfo
if decodedInfo.nodeInfo.num != 0 && !invalidVersion {
if decodedInfo.nodeInfo.num > 0 && !invalidVersion {
nowKnown = true
let nodeInfo = nodeInfoPacket(nodeInfo: decodedInfo.nodeInfo, channel: decodedInfo.packet.channel, context: context!)

View file

@ -230,6 +230,8 @@ func nodeInfoPacket (nodeInfo: NodeInfo, channel: UInt32, context: NSManagedObje
let logString = String.localizedStringWithFormat(NSLocalizedString("mesh.log.nodeinfo.received %@", comment: "Node info received for: %@"), String(nodeInfo.num))
MeshLogger.log("📟 \(logString)")
guard (nodeInfo.num > 0) else { return nil }
let fetchNodeInfoRequest: NSFetchRequest<NSFetchRequestResult> = NSFetchRequest.init(entityName: "NodeInfoEntity")
fetchNodeInfoRequest.predicate = NSPredicate(format: "num == %lld", Int64(nodeInfo.num))
@ -384,6 +386,8 @@ func nodeInfoAppPacket (packet: MeshPacket, context: NSManagedObjectContext) {
let logString = String.localizedStringWithFormat(NSLocalizedString("mesh.log.nodeinfo.received %@", comment: "Node info received for: %@"), String(packet.from))
MeshLogger.log("📟 \(logString)")
guard (packet.from > 0) else { return }
let fetchNodeInfoAppRequest: NSFetchRequest<NSFetchRequestResult> = NSFetchRequest.init(entityName: "NodeInfoEntity")
fetchNodeInfoAppRequest.predicate = NSPredicate(format: "num == %lld", Int64(packet.from))

View file

@ -174,7 +174,7 @@ struct MapViewSwiftUI: UIViewRepresentable {
leftIcon.backgroundColor = UIColor(.accentColor)
annotationView.leftCalloutAccessoryView = leftIcon
let subtitle = UILabel()
if subtitle.text?.count ?? 0 > 0 {
if waypointAnnotation.longDescription?.count ?? 0 > 0 {
subtitle.text = (waypointAnnotation.longDescription ?? "") + "\n"
}
else {

View file

@ -273,11 +273,11 @@ struct WaypointFormView: View {
longitude = coordinate.longitude
}
// if coordinate.distance(from: LocationHelper.DefaultLocation) == 0.0 {
// // Too close to apple park, bail out
// waypointId = 0
// dismiss()
// }
if coordinate.distance(from: LocationHelper.DefaultLocation) == 0.0 {
// Too close to apple park, bail out
waypointId = 0
dismiss()
}
}
}
}